home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
os2
/
octa209b.zip
/
octave-2.09
/
PATOS2.ZIP
/
PATCHES.OS2
< prev
next >
Wrap
Text File
|
1997-08-20
|
125KB
|
4,909 lines
diff -cwr g:/project/C/octave-2.09.orig/liboctave/Array2-idx.h g:/project/C/octave-2.09/liboctave/Array2-idx.h
*** g:/project/C/octave-2.09.orig/liboctave/Array2-idx.h Wed Jun 25 14:59:30 1997
--- g:/project/C/octave-2.09/liboctave/Array2-idx.h Fri Aug 1 12:51:04 1997
***************
*** 226,231 ****
--- 226,233 ----
resize (0, 0);
else
{
+ idx_j.sort (true);
+
int num_to_delete = idx_j.length (nc);
if (num_to_delete != 0)
***************
*** 288,293 ****
--- 290,297 ----
resize (0, 0);
else
{
+ idx_i.sort (true);
+
int num_to_delete = idx_i.length (nr);
if (num_to_delete != 0)
diff -cwr g:/project/C/octave-2.09.orig/liboctave/CMatrix.cc g:/project/C/octave-2.09/liboctave/CMatrix.cc
*** g:/project/C/octave-2.09.orig/liboctave/CMatrix.cc Wed May 28 03:39:20 1997
--- g:/project/C/octave-2.09/liboctave/CMatrix.cc Sun Jul 27 00:29:36 1997
***************
*** 1425,1430 ****
--- 1425,1432 ----
else
lwork = 2*n + (nrhs > m ? nrhs : m);
+ lwork *= 16;
+
Array<Complex> work (lwork);
Complex *pwork = work.fortran_vec ();
***************
*** 1504,1509 ****
--- 1506,1513 ----
lwork = 2*m + (nrhs > n ? nrhs : n);
else
lwork = 2*n + (nrhs > m ? nrhs : m);
+
+ lwork *= 16;
Array<Complex> work (lwork);
Complex *pwork = work.fortran_vec ();
diff -cwr g:/project/C/octave-2.09.orig/liboctave/cmd-hist.cc g:/project/C/octave-2.09/liboctave/cmd-hist.cc
*** g:/project/C/octave-2.09.orig/liboctave/cmd-hist.cc Wed May 28 03:35:52 1997
--- g:/project/C/octave-2.09/liboctave/cmd-hist.cc Fri Mar 7 04:38:20 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 119,129 ****
{
if (! ignoring_entries ())
{
! if (s.empty ()
! || (s.length () == 1 && (s[0] == '\r' || s[0] == '\n')))
return;
! ::add_history (s.c_str ());
lines_this_session++;
}
}
--- 121,141 ----
{
if (! ignoring_entries ())
{
! if (s.empty () ||
! (s.length () == 1 && (s[0] == '\r' || s[0] == '\n' || s[0] == '')))
return;
! string t = s;
! int l = t.length ();
! char c = t[l-2];
! if (c == '\n' || c == '\r' || c == '')
! {
! t.resize (l - 1);
! t[l-2] = '\n';
! if (l == 2) return;
! }
!
! ::add_history (t.c_str ());
lines_this_session++;
}
}
diff -cwr g:/project/C/octave-2.09.orig/liboctave/dMatrix.cc g:/project/C/octave-2.09/liboctave/dMatrix.cc
*** g:/project/C/octave-2.09.orig/liboctave/dMatrix.cc Wed May 28 03:39:20 1997
--- g:/project/C/octave-2.09/liboctave/dMatrix.cc Sun Jul 27 00:30:36 1997
***************
*** 1156,1161 ****
--- 1156,1163 ----
? (2*n > m ? 2*n : m)
: (nrhs > m ? nrhs : m));
+ lwork *= 16;
+
Array<double> work (lwork);
double *pwork = work.fortran_vec ();
***************
*** 1256,1261 ****
--- 1258,1265 ----
lwork = 3*n + (2*n > nrhs
? (2*n > m ? 2*n : m)
: (nrhs > m ? nrhs : m));
+
+ lwork *= 16;
Array<double> work (lwork);
double *pwork = work.fortran_vec ();
diff -cwr g:/project/C/octave-2.09.orig/liboctave/file-ops.cc g:/project/C/octave-2.09/liboctave/file-ops.cc
*** g:/project/C/octave-2.09.orig/liboctave/file-ops.cc Wed May 28 03:35:54 1997
--- g:/project/C/octave-2.09/liboctave/file-ops.cc Wed Aug 20 16:27:52 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 36,42 ****
#include <unistd.h>
#endif
! #include "error.h"
#include "file-ops.h"
#include "lo-error.h"
#include "statdefs.h"
--- 38,47 ----
#include <unistd.h>
#endif
! #ifdef __EMX__
! #include <mkfifo.h>
! #endif
!
#include "file-ops.h"
#include "lo-error.h"
#include "statdefs.h"
***************
*** 256,267 ****
int
oct_mkfifo (const string& name, mode_t mode)
{
! #if defined (HAVE_MKFIFO)
! return mkfifo (name.c_str (), mode);
! #else
! ::error ("mkfifo: not implemented on this system");
! return -1;
! #endif
}
int
--- 261,268 ----
int
oct_mkfifo (const string& name, mode_t mode)
{
! string msg;
! return oct_mkfifo (name, mode, msg);
}
int
***************
*** 277,283 ****
return status;
#else
! ::error ("mkfifo: not implemented on this system");
return -1;
#endif
}
--- 278,284 ----
return status;
#else
! msg = "mkfifo: not implemented on this system";
return -1;
#endif
}
diff -cwr g:/project/C/octave-2.09.orig/liboctave/idx-vector.cc g:/project/C/octave-2.09/liboctave/idx-vector.cc
*** g:/project/C/octave-2.09.orig/liboctave/idx-vector.cc Wed May 28 03:39:22 1997
--- g:/project/C/octave-2.09/liboctave/idx-vector.cc Fri Aug 1 12:46:00 1997
***************
*** 487,492 ****
--- 487,501 ----
}
return colon_equiv;
+ }
+
+ void
+ IDX_VEC_REP::sort (bool uniq)
+ {
+ sort_data (data, len);
+
+ if (uniq)
+ len = make_uniq (data, len);
}
void
diff -cwr g:/project/C/octave-2.09.orig/liboctave/idx-vector.h g:/project/C/octave-2.09/liboctave/idx-vector.h
*** g:/project/C/octave-2.09.orig/liboctave/idx-vector.h Wed May 28 03:39:22 1997
--- g:/project/C/octave-2.09/liboctave/idx-vector.h Fri Aug 1 12:49:00 1997
***************
*** 94,99 ****
--- 94,101 ----
int is_colon (void) const { return colon; }
int is_colon_equiv (int n, int sort_uniq);
+ void sort (bool uniq);
+
int orig_rows (void) const { return orig_nr; }
int orig_columns (void) const { return orig_nc; }
***************
*** 213,218 ****
--- 215,222 ----
int is_colon (void) const { return rep->is_colon (); }
int is_colon_equiv (int n, int sort_uniq = 0) const
{ return rep->is_colon_equiv (n, sort_uniq); }
+
+ void sort (bool uniq = false) { rep->sort (uniq); }
int orig_rows (void) const { return rep->orig_rows (); }
int orig_columns (void) const { return rep->orig_columns (); }
diff -cwr g:/project/C/octave-2.09.orig/liboctave/lo-mappers.cc g:/project/C/octave-2.09/liboctave/lo-mappers.cc
*** g:/project/C/octave-2.09.orig/liboctave/lo-mappers.cc Thu Jul 10 15:57:20 1997
--- g:/project/C/octave-2.09/liboctave/lo-mappers.cc Thu Jul 10 16:19:22 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1997 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 42,49 ****
extern "C"
{
! int F77_FCN (xdgamma, XDGAMMA) (const double&, double&);
!
int F77_FCN (dlgams, DLGAMS) (const double&, double&, double&);
}
--- 44,52 ----
extern "C"
{
! double F77_FCN (derf, DERF) (const double&);
! double F77_FCN (derfc, DERFC) (const double&);
! double F77_FCN (dgamma, DGAMMA) (const double&);
int F77_FCN (dlgams, DLGAMS) (const double&, double&, double&);
}
***************
*** 130,137 ****
#if defined (HAVE_ERF)
return erf (x);
#else
! (*current_liboctave_error_handler)
! ("erf (x) not available on this system");
#endif
}
--- 133,141 ----
#if defined (HAVE_ERF)
return erf (x);
#else
! double y;
! F77_YXFCN (derf, DERF, y, (x));
! return y;
#endif
}
***************
*** 141,148 ****
#if defined (HAVE_ERFC)
return erfc (x);
#else
! (*current_liboctave_error_handler)
! ("erfc (x) not available on this system");
#endif
}
--- 145,153 ----
#if defined (HAVE_ERFC)
return erfc (x);
#else
! double y;
! F77_YXFCN (derfc, DERFC, y, (x));
! return y;
#endif
}
***************
*** 171,181 ****
double
xgamma (double x)
{
! double result;
!
! F77_XFCN (xdgamma, XDGAMMA, (x, result));
!
! return result;
}
double
--- 176,184 ----
double
xgamma (double x)
{
! double y;
! F77_YXFCN (dgamma, DGAMMA, y, (x));
! return y;
}
double
***************
*** 196,202 ****
double result;
double sgngam;
! F77_XFCN (dlgams, DLGAMS, (x, result, sgngam));
return result;
}
--- 199,205 ----
double result;
double sgngam;
! F77_FCN (dlgams, DLGAMS) (x, result, sgngam);
return result;
}
diff -cwr g:/project/C/octave-2.09.orig/liboctave/lo-mappers.h g:/project/C/octave-2.09/liboctave/lo-mappers.h
*** g:/project/C/octave-2.09.orig/liboctave/lo-mappers.h Wed Jun 25 16:19:20 1997
--- g:/project/C/octave-2.09/liboctave/lo-mappers.h Wed Jun 25 16:19:08 1997
***************
*** 20,29 ****
--- 20,33 ----
*/
+ /* Modified by Klaus Gebhardt, 1997 */
+
#if !defined (octave_liboctave_mappers_h)
#define octave_liboctave_mappers_h 1
#include "oct-cmplx.h"
+ #include "oct-math.h"
+ #include "lo-ieee.h"
extern double arg (double x);
extern double conj (double x);
diff -cwr g:/project/C/octave-2.09.orig/libcruft/blas/xerbla.f g:/project/C/octave-2.09/libcruft/blas/xerbla.f
*** g:/project/C/octave-2.09.orig/libcruft/blas/xerbla.f Wed May 28 03:33:48 1997
--- g:/project/C/octave-2.09/libcruft/blas/xerbla.f Mon May 26 20:26:38 1997
***************
*** 33,39 ****
*
WRITE( *, FMT = 9999 )SRNAME, INFO
*
! STOP
*
9999 FORMAT( ' ** On entry to ', A6, ' parameter number ', I2, ' had ',
$ 'an illegal value' )
--- 33,39 ----
*
WRITE( *, FMT = 9999 )SRNAME, INFO
*
! CALL XSTOPX (' ')
*
9999 FORMAT( ' ** On entry to ', A6, ' parameter number ', I2, ' had ',
$ 'an illegal value' )
diff -cwr g:/project/C/octave-2.09.orig/libcruft/misc/d1mach.f g:/project/C/octave-2.09/libcruft/misc/d1mach.f
*** g:/project/C/octave-2.09.orig/libcruft/misc/d1mach.f Wed May 28 03:33:48 1997
--- g:/project/C/octave-2.09/libcruft/misc/d1mach.f Wed Aug 20 17:48:28 1997
***************
*** 1,13 ****
double precision function d1mach (i)
integer i
! logical init
double precision dmach(5)
! save init, dmach
! data init /.false./
! if (.not. init) then
! call machar (dmach(1), dmach(2), dmach(3), dmach(4), dmach(5))
! init = .true.
! endif
if (i .lt. 1 .or. i .gt. 5) goto 999
d1mach = dmach(i)
return
--- 1,22 ----
+ * d1mach.f Do not edit. Generated automatically by gen-d1mach.c
double precision function d1mach(i)
integer i
! integer i1var (2)
! integer i2var (2)
! integer i3var (2)
! integer i4var (2)
! integer i5var (2)
double precision dmach(5)
! equivalence (dmach(1), i1var(1))
! equivalence (dmach(2), i2var(1))
! equivalence (dmach(3), i3var(1))
! equivalence (dmach(4), i4var(1))
! equivalence (dmach(5), i5var(1))
! data i1var(1), i1var(2) / 0 , 1048576 /
! data i2var(1), i2var(2) / -1 , 2146435071 /
! data i3var(1), i3var(2) / 0 , 1017118720 /
! data i4var(1), i4var(2) / 0 , 1018167296 /
! data i5var(1), i5var(2) / 1352628735 , 1070810131 /
if (i .lt. 1 .or. i .gt. 5) goto 999
d1mach = dmach(i)
return
diff -cwr g:/project/C/octave-2.09.orig/libcruft/misc/dostop.c g:/project/C/octave-2.09/libcruft/misc/dostop.c
*** g:/project/C/octave-2.09.orig/libcruft/misc/dostop.c Sat Feb 3 15:33:40 1996
--- g:/project/C/octave-2.09/libcruft/misc/dostop.c Sat Feb 8 15:11:04 1997
***************
*** 21,26 ****
--- 21,28 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 30,35 ****
--- 32,42 ----
#include "f77-fcn.h"
#include "lo-error.h"
+
+ #ifdef __EMX__
+ int f77_exception_encountered;
+ jmp_buf f77_context;
+ #endif
/* All the STOP statements in the Fortran routines have been replaced
with a call to XSTOPX, defined in the file libcruft/misc/xstopx.f.
diff -cwr g:/project/C/octave-2.09.orig/libcruft/misc/f77-fcn.h g:/project/C/octave-2.09/libcruft/misc/f77-fcn.h
*** g:/project/C/octave-2.09.orig/libcruft/misc/f77-fcn.h Sun Mar 3 02:16:14 1996
--- g:/project/C/octave-2.09/libcruft/misc/f77-fcn.h Sat Feb 8 15:41:26 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1997 */
+
#if !defined (octave_f77_fcn_h)
#define octave_f77_fcn_h 1
***************
*** 77,82 ****
--- 79,103 ----
} \
else \
F77_FCN (f, F) args; \
+ copy_f77_context ((char *) saved_f77_context, (char *) f77_context, \
+ sizeof (jmp_buf)); \
+ } \
+ while (0)
+
+ #define F77_YXFCN(f, F, rc, args) \
+ do \
+ { \
+ jmp_buf saved_f77_context; \
+ f77_exception_encountered = 0; \
+ copy_f77_context ((char *) f77_context, (char *) saved_f77_context, \
+ sizeof (jmp_buf)); \
+ if (setjmp (f77_context)) \
+ { \
+ f77_exception_encountered = 1; \
+ F77_XFCN_ERROR (f, F); \
+ } \
+ else \
+ rc = F77_FCN (f, F) args; \
copy_f77_context ((char *) saved_f77_context, (char *) f77_context, \
sizeof (jmp_buf)); \
} \
diff -cwr g:/project/C/octave-2.09.orig/src/defaults.cc g:/project/C/octave-2.09/src/defaults.cc
*** g:/project/C/octave-2.09.orig/src/defaults.cc Thu Jul 10 15:57:22 1997
--- g:/project/C/octave-2.09/src/defaults.cc Wed Aug 13 14:55:10 1997
***************
*** 28,33 ****
--- 28,35 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 - 1997 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 160,166 ****
if (shell_path)
{
! Vexec_path = string (":");
Vexec_path.append (shell_path);
}
}
--- 162,168 ----
if (shell_path)
{
! Vexec_path = string (SEPCHAR_STR);
Vexec_path.append (shell_path);
}
}
***************
*** 200,214 ****
--- 202,224 ----
Vinfo_prog = string (oct_info_prog);
else
{
+ #if !defined (__EMX__)
Vinfo_prog = Varch_lib_dir;
Vinfo_prog.append ("/info");
+ #else
+ Vinfo_prog = "";
+ #endif
}
}
static void
set_default_editor (void)
{
+ #if defined (__EMX__) && defined (OS2)
+ Veditor = "e";
+ #else
Veditor = "emacs";
+ #endif
char *env_editor = getenv ("EDITOR");
***************
*** 338,345 ****
if (eplen > 0)
{
! int prepend = (Vexec_path[0] == ':');
! int append = (eplen > 1 && Vexec_path[eplen-1] == ':');
if (prepend)
{
--- 348,355 ----
if (eplen > 0)
{
! int prepend = (Vexec_path[0] == SEPCHAR);
! int append = (eplen > 1 && Vexec_path[eplen-1] == SEPCHAR);
if (prepend)
{
diff -cwr g:/project/C/octave-2.09.orig/src/file-io.cc g:/project/C/octave-2.09/src/file-io.cc
*** g:/project/C/octave-2.09.orig/src/file-io.cc Wed May 28 03:39:28 1997
--- g:/project/C/octave-2.09/src/file-io.cc Wed May 28 03:03:18 1997
***************
*** 34,39 ****
--- 34,41 ----
// Completely rewritten by John W. Eaton <jwe@bevo.che.wisc.edu>,
// April 1996.
+ /* Modified by Klaus Gebhardt, 1997 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 62,67 ****
--- 64,70 ----
#include "oct-stream.h"
#include "oct-strstrm.h"
#include "pager.h"
+ #include "sighandlers.h"
#include "sysdep.h"
#include "utils.h"
#include "variables.h"
***************
*** 1282,1287 ****
--- 1285,1325 ----
}
DEFALIAS (octave_tmp_file_name, tmpnam);
+
+ DEFUN (child_purge_temp, args, ,
+ "child_purge_temp (pid, name)\n\
+ Remove the file NAME, when child PID dies.")
+ {
+ octave_value retval = -1.0;
+
+ if (args.length () == 2)
+ {
+ if (args(1).is_string ())
+ {
+ double d_pid = args(0).double_value ();
+ string name = args(1).string_value ();
+
+ if (!error_state)
+ {
+ if (D_NINT (d_pid) == d_pid)
+ {
+ int i_pid = NINT (d_pid);
+
+ octave_child_list::insert (i_pid, 0, name);
+ retval = 0.0;
+ }
+ else
+ error ("child_purge_temp: pid must be an integer");
+ }
+ }
+ else
+ error ("child_purge_temp: second argument must be a string");
+ }
+ else
+ print_usage ("child_purge_temp");
+
+ return retval;
+ }
static int
convert (int x, int ibase, int obase)
diff -cwr g:/project/C/octave-2.09.orig/src/help.cc g:/project/C/octave-2.09/src/help.cc
*** g:/project/C/octave-2.09.orig/src/help.cc Wed May 28 03:36:46 1997
--- g:/project/C/octave-2.09/src/help.cc Thu Aug 14 17:06:18 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 65,70 ****
--- 67,87 ----
#include "utils.h"
#include "variables.h"
+ #if defined (__EMX__)
+ extern "C"
+ {
+ #include "info/info.h"
+ #include "info/dribble.h"
+ #include "info/terminal.h"
+
+ extern int external_info_search ();
+ extern int index_entry_exists ();
+ extern int do_info_index_search ();
+ extern void finish_info_session ();
+ extern char *replace_in_documentation ();
+ }
+ #endif
+
// Name of the info file specified on command line.
// (--info-file file)
string Vinfo_file;
***************
*** 526,531 ****
--- 543,550 ----
static int
try_info (const string& nm)
{
+ if (Vinfo_prog.length () > 0)
+ {
int status = 0;
static char *cmd_str = 0;
***************
*** 567,578 ****
return status;
}
static void
help_from_info (const string_vector& argv, int idx, int argc)
{
if (idx == argc)
! try_info (string ());
else
{
for (int i = idx; i < argc; i++)
--- 586,662 ----
return status;
}
+ else
+ {
+ volatile octave_interrupt_handler old_interrupt_handler
+ = octave_ignore_interrupts ();
+
+ int status = 0;
+
+ char *directory_name = strdup (Vinfo_file.c_str ());
+ char *temp = filename_non_directory (directory_name);
+
+ if (temp != directory_name)
+ {
+ *temp = 0;
+ info_add_path (directory_name, INFOPATH_PREPEND);
+ }
+
+ delete [] directory_name;
+
+ NODE *initial_node = info_get_node (Vinfo_file.c_str (), 0);
+
+ if (! initial_node) status = 127;
+ else
+ {
+ status = external_info_search(initial_node, 0,
+ Vinfo_file.c_str (), nm.c_str ());
+ if (status == 1)
+ {
+ char *format = replace_in_documentation
+ ("Type \"\\[quit]\" to quit, \"\\[get-help-window]\" for help.");
+ window_message_in_echo_area (format);
+
+ info_read_and_dispatch ();
+
+ #ifdef __EMX__
+ terminal_goto_xy (0, screenheight - 2);
+ #else
+ terminal_goto_xy (0, screenheight - 1);
+ #endif
+ terminal_clear_to_eol ();
+ terminal_unprep_terminal ();
+ }
+
+ status = status * status - 1;
+
+ finish_info_session (initial_node, 0);
+ }
+
+ octave_set_interrupt_handler (old_interrupt_handler);
+
+ return status;
+ }
+ }
static void
help_from_info (const string_vector& argv, int idx, int argc)
{
if (idx == argc)
! {
! int status = try_info (string ());
!
! if (status)
! {
! if (status < 0)
! {
! message ("help", "sorry, `%s' is not indexed in the manual",
! string ().c_str ());
! sleep (2);
! }
! else error ("help: unable to find info!");
! }
! }
else
{
for (int i = idx; i < argc; i++)
***************
*** 983,988 ****
--- 1067,1073 ----
string s = builtin_string_variable ("INFO_PROGRAM");
+ #ifndef __EMX__
if (s.empty ())
{
gripe_invalid_value_specified ("INFO_PROGRAM");
***************
*** 990,995 ****
--- 1075,1083 ----
}
else
Vinfo_prog = s;
+ #else
+ Vinfo_prog = s;
+ #endif
return status;
}
diff -cwr g:/project/C/octave-2.09.orig/src/input.cc g:/project/C/octave-2.09/src/input.cc
*** g:/project/C/octave-2.09.orig/src/input.cc Wed May 28 03:39:28 1997
--- g:/project/C/octave-2.09/src/input.cc Wed May 28 04:14:42 1997
***************
*** 30,35 ****
--- 30,37 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
// Use the GNU readline library for command line editing and hisory.
#ifdef HAVE_CONFIG_H
***************
*** 120,125 ****
--- 122,131 ----
// Nonzero means the user forced this shell to be interactive (-i).
int forced_interactive = 0;
+ // Nonzero means the user forced this shell to be really interactive (-i),
+ // but without using the pager.
+ int really_forced_interactive = 0;
+
// Should we issue a prompt?
int promptflag = 1;
***************
*** 429,435 ****
}
else
{
! if (s && *s && (interactive || forced_interactive))
{
fprintf (rl_outstream, s);
fflush (rl_outstream);
--- 435,442 ----
}
else
{
! if (s && *s &&
! (interactive || forced_interactive || really_forced_interactive))
{
fprintf (rl_outstream, s);
fflush (rl_outstream);
***************
*** 494,500 ****
{
char *retval = 0;
! if ((interactive || forced_interactive)
&& (! (reading_fcn_file || reading_script_file)))
{
const char *ps = (promptflag > 0) ? Vps1.c_str () :
--- 501,507 ----
{
char *retval = 0;
! if ((interactive || forced_interactive || really_forced_interactive)
&& (! (reading_fcn_file || reading_script_file)))
{
const char *ps = (promptflag > 0) ? Vps1.c_str () :
***************
*** 637,643 ****
FILE *instream = 0;
if (name.length () > 0)
! instream = fopen (name.c_str (), "r");
if (! instream && warn)
warning ("%s: no such file or directory", name.c_str ());
--- 644,650 ----
FILE *instream = 0;
if (name.length () > 0)
! instream = fopen (name.c_str (), "rb");
if (! instream && warn)
warning ("%s: no such file or directory", name.c_str ());
diff -cwr g:/project/C/octave-2.09.orig/src/input.h g:/project/C/octave-2.09/src/input.h
*** g:/project/C/octave-2.09.orig/src/input.h Sun Jun 23 04:45:44 1996
--- g:/project/C/octave-2.09/src/input.h Wed Dec 11 05:26:08 1996
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
// Use the GNU readline library for command line editing and hisory.
#if !defined (octave_input_h)
***************
*** 60,65 ****
--- 62,71 ----
// Nonzero means the user forced this shell to be interactive (-i).
extern int forced_interactive;
+
+ // Nonzero means the user forced this shell to be really interactive (-i),
+ // but without using the pager.
+ extern int really_forced_interactive;
// Should we issue a prompt?
extern int promptflag;
diff -cwr g:/project/C/octave-2.09.orig/src/lex.l g:/project/C/octave-2.09/src/lex.l
*** g:/project/C/octave-2.09.orig/src/lex.l Wed May 28 03:39:28 1997
--- g:/project/C/octave-2.09/src/lex.l Mon May 26 19:10:56 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
%s TEXT_FCN
%s MATRIX
***************
*** 191,197 ****
D [0-9]
S [ \t]
! NL ((\n)|(\r\n))
SNL ({S}|{NL})
EL (\.\.\.)
BS (\\)
--- 193,199 ----
D [0-9]
S [ \t]
! NL ((\n)|(\r)|(\r\n)|())
SNL ({S}|{NL})
EL (\.\.\.)
BS (\\)
***************
*** 244,250 ****
return handle_string (yytext[0], 1);
}
! <TEXT_FCN>[^ \t\n\;\,]*{S}* {
string tok = strip_trailing_whitespace (yytext);
TOK_PUSH_AND_RETURN (tok, TEXT);
}
--- 246,252 ----
return handle_string (yytext[0], 1);
}
! <TEXT_FCN>[^ \t\r\n\;\,]*{S}* {
string tok = strip_trailing_whitespace (yytext);
TOK_PUSH_AND_RETURN (tok, TEXT);
}
***************
*** 540,546 ****
else
{
int c;
! while ((c = yyinput ()) != EOF && c != '\n')
; // Eat comment.
}
--- 542,548 ----
else
{
int c;
! while ((c = yyinput ()) != EOF && c != '\n' && c != '\r' && c != '')
; // Eat comment.
}
***************
*** 690,696 ****
// Only ask for input from stdin if we are expecting interactive
// input.
! if (interactive && ! (reading_fcn_file || get_input_from_eval_string))
yyrestart (stdin);
// Clear the buffer for help text.
--- 692,699 ----
// Only ask for input from stdin if we are expecting interactive
// input.
! if ((interactive || really_forced_interactive) &&
! ! (reading_fcn_file || get_input_from_eval_string))
yyrestart (stdin);
// Clear the buffer for help text.
***************
*** 781,787 ****
char c;
while ((c = *s++) != '\0')
{
! if (c == '\n')
current_input_column = 1;
else
current_input_column++;
--- 784,790 ----
char c;
while ((c = *s++) != '\0')
{
! if (c == '\n' || c == '\r' || c == '')
current_input_column = 1;
else
current_input_column++;
***************
*** 1111,1117 ****
bool begin_comment = true;
bool in_comment = true;
! int c = 0;
while ((c = yyinput ()) != EOF)
{
--- 1114,1120 ----
bool begin_comment = true;
bool in_comment = true;
! int c = 0, d, ct;
while ((c = yyinput ()) != EOF)
{
***************
*** 1125,1136 ****
if (in_comment)
{
! help_buf += (char) c;
- if (c == '\n')
in_comment = false;
}
else
{
switch (c)
{
--- 1128,1157 ----
if (in_comment)
{
! if (c == '\n' || c == '\r' || c == '')
! {
! ct = 0;
! d = c;
!
! do
! {
! if (d == '\n' || d == '')
! {
! if (++ct > 1) break;
! help_buf += (char) '\n';
! }
! }
! while (((d = yyinput ()) != EOF) &&
! (d == '\n' || d == '\r' || d == ''));
!
! if (d != EOF) yyunput (d, yytext);
in_comment = false;
}
else
+ help_buf += (char) c;
+ }
+ else
{
switch (c)
{
***************
*** 1317,1322 ****
--- 1338,1345 ----
retval |= ATE_SPACE_OR_TAB;
break;
+ case '':
+ case '\r':
case '\n':
retval |= ATE_NEWLINE;
in_comment = 0;
***************
*** 1434,1439 ****
--- 1457,1464 ----
goto cleanup;
break;
+ case '':
+ case '\r':
case '\n':
current_input_column = 0;
promptflag--;
***************
*** 1542,1548 ****
if (! have_ellipsis_continuation (0))
buf << (char) c;
}
! else if (c == '\n')
{
error ("unterminated string constant");
break;
--- 1567,1573 ----
if (! have_ellipsis_continuation (0))
buf << (char) c;
}
! else if (c == '\n' || c == '\r' || c == '')
{
error ("unterminated string constant");
break;
***************
*** 1640,1646 ****
int postfix_un_op = next_token_is_postfix_unary_op
(spc_gobbled, yytext);
! int other_op = match_any (c1, ",;\n]");
if (! (postfix_un_op || bin_op || other_op)
&& nesting_level.is_brace ()
--- 1665,1671 ----
int postfix_un_op = next_token_is_postfix_unary_op
(spc_gobbled, yytext);
! int other_op = match_any (c1, ",;\n\r]");
if (! (postfix_un_op || bin_op || other_op)
&& nesting_level.is_brace ()
***************
*** 1673,1679 ****
int c2 = yyinput ();
unput (c2);
unput (c1);
! int sep_op = match_any (c1, ",;\n]");
int dot_op = (c1 == '.'
&& (isalpha (c2) || isspace (c2) || c2 == '_'));
int index_op = (c1 == '('
--- 1698,1704 ----
int c2 = yyinput ();
unput (c2);
unput (c1);
! int sep_op = match_any (c1, ",;\n\r]");
int dot_op = (c1 == '.'
&& (isalpha (c2) || isspace (c2) || c2 == '_'));
int index_op = (c1 == '('
***************
*** 1866,1871 ****
--- 1891,1898 ----
case ',':
break;
+ case '':
+ case '\r':
case '\n':
if (in_comment)
in_comment = 0;
diff -cwr g:/project/C/octave-2.09.orig/src/mappers.cc g:/project/C/octave-2.09/src/mappers.cc
*** g:/project/C/octave-2.09.orig/src/mappers.cc Thu Jun 5 03:13:30 1997
--- g:/project/C/octave-2.09/src/mappers.cc Wed Jun 25 16:16:48 1997
***************
*** 20,33 ****
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cctype>
#include <cfloat>
-
- #include "lo-mappers.h"
#include "defun.h"
#include "error.h"
--- 20,33 ----
*/
+ /* Modified by Klaus Gebhardt, 1997 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cctype>
#include <cfloat>
#include "defun.h"
#include "error.h"
diff -cwr g:/project/C/octave-2.09.orig/src/mappers.h g:/project/C/octave-2.09/src/mappers.h
*** g:/project/C/octave-2.09.orig/src/mappers.h Fri May 24 05:08:38 1996
--- g:/project/C/octave-2.09/src/mappers.h Wed Jun 25 16:17:02 1997
***************
*** 20,32 ****
*/
#if !defined (octave_mappers_h)
#define octave_mappers_h 1
#include <string>
#include "lo-mappers.h"
- #include "oct-cmplx.h"
typedef int (*ch_Mapper)(int);
typedef double (*d_d_Mapper)(double);
--- 20,33 ----
*/
+ /* Modified by Klaus Gebhardt, 1997 */
+
#if !defined (octave_mappers_h)
#define octave_mappers_h 1
#include <string>
#include "lo-mappers.h"
typedef int (*ch_Mapper)(int);
typedef double (*d_d_Mapper)(double);
diff -cwr g:/project/C/octave-2.09.orig/src/oct-hist.cc g:/project/C/octave-2.09/src/oct-hist.cc
*** g:/project/C/octave-2.09.orig/src/oct-hist.cc Wed May 28 03:36:46 1997
--- g:/project/C/octave-2.09/src/oct-hist.cc Sat Mar 15 18:35:44 1997
***************
*** 27,32 ****
--- 27,34 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 64,69 ****
--- 66,79 ----
#include "utils.h"
#include "variables.h"
+ #ifdef __EMX__
+ extern "C"
+ {
+ #include <process.h>
+ int _IO_system (const char *, int);
+ }
+ #endif
+
// Nonzero means input is coming from temporary history file.
int input_from_tmp_history_file = 0;
***************
*** 283,289 ****
int cmd_len = cmd.length ();
! if (cmd[cmd_len - 1] == '\n')
cmd.resize (cmd_len - 1);
if (! cmd.empty ())
--- 293,300 ----
int cmd_len = cmd.length ();
! if (cmd[cmd_len - 1] == '\n' || cmd[cmd_len - 1] == '\r'
! || cmd[cmd_len - 1] == '')
cmd.resize (cmd_len - 1);
if (! cmd.empty ())
***************
*** 302,308 ****
int len = tmp.length ();
! if (len > 0 && tmp[len-1] == '\n')
tmp.resize (len - 1);
if (! tmp.empty ())
--- 313,320 ----
int len = tmp.length ();
! if (len > 0 &&
! (tmp[len-1] == '\n' || tmp[len-1] == '\r' || tmp[len-1] == ''))
tmp.resize (len - 1);
if (! tmp.empty ())
***************
*** 430,436 ****
--- 442,452 ----
volatile octave_interrupt_handler old_interrupt_handler
= octave_ignore_interrupts ();
+ #ifdef __EMX__
+ _IO_system (cmd.c_str (), P_WAIT);
+ #else
system (cmd.c_str ());
+ #endif
octave_set_interrupt_handler (old_interrupt_handler);
diff -cwr g:/project/C/octave-2.09.orig/src/octave.cc g:/project/C/octave-2.09/src/octave.cc
*** g:/project/C/octave-2.09.orig/src/octave.cc Wed May 28 03:39:28 1997
--- g:/project/C/octave-2.09/src/octave.cc Mon May 26 18:12:16 1997
***************
*** 22,27 ****
--- 22,29 ----
// Born February 20, 1992.
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 47,52 ****
--- 49,59 ----
#include <pwd.h>
#endif
+ #ifdef __EMX__
+ #include <float.h>
+ #include <sys/uflags.h>
+ #endif
+
#include "lo-error.h"
#include "str-vec.h"
***************
*** 121,127 ****
// Usage message
static const char *usage_string =
! "octave [-?Vdfhiqvx] [--debug] [--echo-commands] [--exec-path path]\n\
[--help] [--info-file file] [--info-program prog] [--interactive]\n\
[--no-init-file] [--no-line-editing] [--no-site-file] [-p path]\n\
[--path path] [--silent] [--traditional] [--verbose] [--version] [file]";
--- 128,134 ----
// Usage message
static const char *usage_string =
! "octave [-?VdfhiIqvx] [--debug] [--echo-commands] [--exec-path path]\n\
[--help] [--info-file file] [--info-program prog] [--interactive]\n\
[--no-init-file] [--no-line-editing] [--no-site-file] [-p path]\n\
[--path path] [--silent] [--traditional] [--verbose] [--version] [file]";
***************
*** 129,135 ****
// This is here so that it's more likely that the usage message and
// the real set of options will agree. Note: the `+' must come first
// to prevent getopt from permuting arguments!
! static const char *short_opts = "+?Vdfhip:qvx";
// Long options. See the comments in getopt.h for the meanings of the
// fields in this structure.
--- 136,142 ----
// This is here so that it's more likely that the usage message and
// the real set of options will agree. Note: the `+' must come first
// to prevent getopt from permuting arguments!
! static const char *short_opts = "+?VdfhiIp:qvx";
// Long options. See the comments in getopt.h for the meanings of the
// fields in this structure.
***************
*** 326,331 ****
--- 333,339 ----
--info-file FILE Use top-level info file FILE.\n\
--info-program PROGRAM Use PROGRAM for reading info files.\n\
-i, --interactive Force interactive behavior.\n\
+ -I Force really interactive behavior, but no pager.\n\
--no-init-file Don't read the ~/.octaverc or .octaverc files.\n\
--no-line-editing Don't use readline for command-line editing.\n\
--no-site-file Don't read the site-wide octaverc file.\n\
***************
*** 452,457 ****
--- 460,469 ----
forced_interactive = 1;
break;
+ case 'I':
+ really_forced_interactive = 1;
+ break;
+
case 'p':
if (args.optarg ())
bind_builtin_variable ("LOADPATH", args.optarg ());
***************
*** 539,544 ****
--- 551,563 ----
if (! inhibit_startup_message && reading_startup_message_printed)
cout << endl;
+ #if defined (__EMX__)
+ _control87 (EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW |
+ EM_UNDERFLOW | EM_INEXACT, MCW_EM);
+
+ _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
+ #endif
+
// Avoid counting commands executed from startup files.
current_command_number = 1;
***************
*** 594,610 ****
// Force input to be echoed if not really interactive, but the user
// has forced interactive behavior.
! if (! interactive && forced_interactive)
{
rl_blink_matching_paren = 0;
// XXX FIXME XXX -- is this the right thing to do?
bind_builtin_variable ("echo_executing_commands",
(double) ECHO_CMD_LINE);
}
! if (! interactive)
using_readline = 0;
int retval = main_loop ();
--- 613,631 ----
// Force input to be echoed if not really interactive, but the user
// has forced interactive behavior.
! if (! interactive && (forced_interactive || really_forced_interactive))
{
rl_blink_matching_paren = 0;
// XXX FIXME XXX -- is this the right thing to do?
+ #if ! defined (__EMX__)
bind_builtin_variable ("echo_executing_commands",
(double) ECHO_CMD_LINE);
+ #endif
}
! if (! (interactive || really_forced_interactive))
using_readline = 0;
int retval = main_loop ();
diff -cwr g:/project/C/octave-2.09.orig/src/op-str-str.cc g:/project/C/octave-2.09/src/op-str-str.cc
*** g:/project/C/octave-2.09.orig/src/op-str-str.cc Wed May 28 03:34:04 1997
--- g:/project/C/octave-2.09/src/op-str-str.cc Wed Jan 29 05:16:18 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1997 */
+
#if defined (__GNUG__)
#pragma implementation
#endif
***************
*** 50,69 ****
if (cm2.rows () == 1 && cm2.columns () == 1)
return octave_value (cm1 (0, 0) == cm2 (0, 0));
else
! SC_MX_BOOL_OP (char, c, cm1 (0, 0), charMatrix, m, cm2,
c == m (i, j), 0.0);
}
else
{
! int cm2_nr = cm2.rows ();
! int cm2_nc = cm2.cols ();
!
! if (cm2_nr == 1 && cm2_nc == 1)
! MX_SC_BOOL_OP (charMatrix, m, cm1, char, c, cm2 (0, 0),
c == m (i, j), 0.0);
else
! MX_MX_BOOL_OP (charMatrix, m1, cm1, charMatrix, m2, cm2,
! m1 (i, j) == m2 (i, j), "==", 0.0, 1.0);
}
}
--- 52,72 ----
if (cm2.rows () == 1 && cm2.columns () == 1)
return octave_value (cm1 (0, 0) == cm2 (0, 0));
else
! SC_MX_BOOL_OP (char, c, cm1 (0, 0), \
! charMatrix, m, cm2, \
c == m (i, j), 0.0);
}
else
{
! if (cm2.rows () == 1 && cm2.columns () == 1)
! MX_SC_BOOL_OP (charMatrix, m, cm1, \
! char, c, cm2 (0, 0), \
c == m (i, j), 0.0);
else
! MX_MX_BOOL_OP (charMatrix, m1, cm1, \
! charMatrix, m2, cm2, \
! m1 (i, j) == m2 (i, j), \
! "==", 0.0, 1.0);
}
}
diff -cwr g:/project/C/octave-2.09.orig/src/pager.cc g:/project/C/octave-2.09/src/pager.cc
*** g:/project/C/octave-2.09.orig/src/pager.cc Wed May 28 03:39:30 1997
--- g:/project/C/octave-2.09/src/pager.cc Mon May 26 18:18:04 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 212,218 ****
int
octave_pager_buf::sync (void)
{
! if (! interactive
|| really_flush_to_pager
|| (Vpage_screen_output && Vpage_output_immediately)
|| ! Vpage_screen_output)
--- 214,220 ----
int
octave_pager_buf::sync (void)
{
! if ((! interactive || really_forced_interactive)
|| really_flush_to_pager
|| (Vpage_screen_output && Vpage_output_immediately)
|| ! Vpage_screen_output)
***************
*** 221,227 ****
char *buf = eback ();
! bool bypass_pager = (! interactive
|| ! Vpage_screen_output
|| (really_flush_to_pager
&& Vpage_screen_output
--- 223,229 ----
char *buf = eback ();
! bool bypass_pager = ((! interactive || really_forced_interactive)
|| ! Vpage_screen_output
|| (really_flush_to_pager
&& Vpage_screen_output
diff -cwr g:/project/C/octave-2.09.orig/src/parse.y g:/project/C/octave-2.09/src/parse.y
*** g:/project/C/octave-2.09.orig/src/parse.y Wed May 28 03:39:30 1997
--- g:/project/C/octave-2.09/src/parse.y Sun Jul 20 18:18:30 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
// Parser for Octave.
// C decarations.
***************
*** 252,258 ****
{ \
global_command = 0; \
yyerrok; \
! if (interactive || forced_interactive) \
YYACCEPT; \
else \
YYABORT; \
--- 254,260 ----
{ \
global_command = 0; \
yyerrok; \
! if (interactive || forced_interactive || really_forced_interactive) \
YYACCEPT; \
else \
YYABORT; \
***************
*** 370,376 ****
%type <subplot_style_type> style
// Precedence and associativity.
! %left ';' ',' '\n'
%right '='
%left EXPR_AND_AND EXPR_OR_OR
%left EXPR_AND EXPR_OR
--- 372,378 ----
%type <subplot_style_type> style
// Precedence and associativity.
! %left ';' ',' '\n' '\r' ''
%right '='
%left EXPR_AND_AND EXPR_OR_OR
%left EXPR_AND EXPR_OR
***************
*** 413,422 ****
--- 415,432 ----
input1 : '\n'
{ $$ = 0; }
+ | '\r'
+ { $$ = 0; }
+ | ''
+ { $$ = 0; }
| simple_list
{ $$ = $1; }
| simple_list '\n'
{ $$ = $1; }
+ | simple_list '\r'
+ { $$ = $1; }
+ | simple_list ''
+ { $$ = $1; }
| simple_list END_OF_INPUT
{ $$ = $1; }
;
***************
*** 1069,1080 ****
--- 1079,1092 ----
}
| param_list1 param_list_end
{
+ lexer_flags.looking_at_parameter_list = 0;
lexer_flags.quote_is_transpose = 0;
$1->mark_as_formal_parameters ();
$$ = $1;
}
| param_list1 ',' ELLIPSIS param_list_end
{
+ lexer_flags.looking_at_parameter_list = 0;
lexer_flags.quote_is_transpose = 0;
$1->mark_as_formal_parameters ();
$1->mark_varargs ();
***************
*** 1201,1212 ****
--- 1213,1228 ----
{ $$ = ';'; }
| '\n'
{ $$ = '\n'; }
+ | '\r'
+ { $$ = '\r'; }
| sep ','
{ $$ = $1; }
| sep ';'
{ $$ = $1; }
| sep '\n'
{ $$ = $1; }
+ | sep '\r'
+ { $$ = $1; }
;
opt_sep : // empty
***************
*** 2331,2336 ****
--- 2347,2353 ----
case 0:
case ',':
case '\n':
+ case '\r':
if (warn_missing_semi)
maybe_warn_missing_semi (list);
break;
diff -cwr g:/project/C/octave-2.09.orig/src/pt-plot.cc g:/project/C/octave-2.09/src/pt-plot.cc
*** g:/project/C/octave-2.09.orig/src/pt-plot.cc Wed May 28 03:36:46 1997
--- g:/project/C/octave-2.09/src/pt-plot.cc Fri Mar 7 04:48:20 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
#if defined (__GNUG__)
#pragma implementation
#endif
***************
*** 172,184 ****
sigemptyset (&set);
sigaddset (&set, SIGINT);
sigprocmask (SIG_BLOCK, &set, &oset);
#else
volatile octave_interrupt_handler old_interrupt_handler
= octave_ignore_interrupts ();
#endif
-
plot_stream = new oprocstream (plot_prog.c_str ());
!
if (plot_stream)
{
if (! *plot_stream)
--- 174,190 ----
sigemptyset (&set);
sigaddset (&set, SIGINT);
sigprocmask (SIG_BLOCK, &set, &oset);
+ #endif
+
+ #if defined (__EMX__) && defined (OS2)
+ plot_stream = new oprocstream (plot_prog.c_str (), ios::out);
#else
+ #if !defined (HAVE_POSIX_SIGNALS)
volatile octave_interrupt_handler old_interrupt_handler
= octave_ignore_interrupts ();
#endif
plot_stream = new oprocstream (plot_prog.c_str ());
! #endif
if (plot_stream)
{
if (! *plot_stream)
***************
*** 201,208 ****
--- 207,216 ----
#if defined (HAVE_POSIX_SIGNALS)
sigprocmask (SIG_SETMASK, &oset, 0);
#else
+ #if ! defined (__EMX__) || ! defined (OS2)
octave_set_interrupt_handler (old_interrupt_handler);
#endif
+ #endif
}
if (! error_state && plot_stream && *plot_stream && ! initialized)
***************
*** 1090,1095 ****
--- 1098,1104 ----
char *plot_command = plot_buf.str ();
send_to_plot_stream (plot_command);
+ sleep (2);
delete [] plot_command;
diff -cwr g:/project/C/octave-2.09.orig/src/rand.cc g:/project/C/octave-2.09/src/rand.cc
*** g:/project/C/octave-2.09.orig/src/rand.cc Sun Nov 3 09:22:46 1996
--- g:/project/C/octave-2.09/src/rand.cc Sat Jul 19 14:30:48 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1997 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 72,78 ****
{
union d2i { double d; int i[2]; };
union d2i u;
! F77_FCN (getsd, GETSD) (u.i[0], u.i[1]);
return u.d;
}
--- 74,80 ----
{
union d2i { double d; int i[2]; };
union d2i u;
! F77_XFCN (getsd, GETSD, (u.i[0], u.i[1]));
return u.d;
}
***************
*** 99,105 ****
u.d = val;
int i0 = force_to_fit_range (u.i[0], 1, 2147483563);
int i1 = force_to_fit_range (u.i[1], 1, 2147483399);
! F77_FCN (setsd, SETSD) (i0, i1);
}
static char *
--- 101,107 ----
u.d = val;
int i0 = force_to_fit_range (u.i[0], 1, 2147483563);
int i1 = force_to_fit_range (u.i[1], 1, 2147483399);
! F77_XFCN (setsd, SETSD, (i0, i1));
}
static char *
***************
*** 140,146 ****
s0 = force_to_fit_range (s0, 1, 2147483563);
s1 = force_to_fit_range (s1, 1, 2147483399);
! F77_FCN (setall, SETALL) (s0, s1);
initialized = 1;
}
--- 142,148 ----
s0 = force_to_fit_range (s0, 1, 2147483563);
s1 = force_to_fit_range (s1, 1, 2147483399);
! F77_XFCN (setall, SETALL, (s0, s1));
initialized = 1;
}
***************
*** 180,192 ****
{
current_distribution = uniform_dist;
! F77_FCN (setcgn, SETCGN) (uniform_dist);
}
else if (s_arg == "normal")
{
current_distribution = normal_dist;
! F77_FCN (setcgn, SETCGN) (normal_dist);
}
else
error ("rand: unrecognized string argument");
--- 182,194 ----
{
current_distribution = uniform_dist;
! F77_XFCN (setcgn, SETCGN, (uniform_dist));
}
else if (s_arg == "normal")
{
current_distribution = normal_dist;
! F77_XFCN (setcgn, SETCGN, (normal_dist));
}
else
error ("rand: unrecognized string argument");
***************
*** 302,313 ****
switch (current_distribution)
{
case uniform_dist:
! F77_FCN (dgenunf, DGENUNF) (0.0, 1.0, val);
rand_mat (i, j) = val;
break;
case normal_dist:
! F77_FCN (dgennor, DGENNOR) (0.0, 1.0, val);
rand_mat (i, j) = val;
break;
--- 304,315 ----
switch (current_distribution)
{
case uniform_dist:
! F77_XFCN (dgenunf, DGENUNF, (0.0, 1.0, val));
rand_mat (i, j) = val;
break;
case normal_dist:
! F77_XFCN (dgennor, DGENNOR, (0.0, 1.0, val));
rand_mat (i, j) = val;
break;
***************
*** 356,362 ****
static void
reset_rand_generator (void *)
{
! F77_FCN (setcgn, SETCGN) (current_distribution);
}
DEFUN_DLD (randn, args, nargout,
--- 358,364 ----
static void
reset_rand_generator (void *)
{
! F77_XFCN (setcgn, SETCGN, (current_distribution));
}
DEFUN_DLD (randn, args, nargout,
***************
*** 393,399 ****
current_distribution = normal_dist;
! F77_FCN (setcgn, SETCGN) (normal_dist);
retval = do_rand (args, nargin);
--- 395,401 ----
current_distribution = normal_dist;
! F77_XFCN (setcgn, SETCGN, (normal_dist));
retval = do_rand (args, nargin);
diff -cwr g:/project/C/octave-2.09.orig/src/sighandlers.cc g:/project/C/octave-2.09/src/sighandlers.cc
*** g:/project/C/octave-2.09.orig/src/sighandlers.cc Wed May 28 03:39:30 1997
--- g:/project/C/octave-2.09/src/sighandlers.cc Thu May 29 23:00:32 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1995 - 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 38,43 ****
--- 40,50 ----
#include <unistd.h>
#endif
+ #ifdef __EMX__
+ #include <float.h>
+ #include <sys/uflags.h>
+ #endif
+
#include "error.h"
#include "load-save.h"
#include "pager.h"
***************
*** 81,87 ****
#if defined (__EMX__)
#define MAYBE_ACK_SIGNAL(sig) \
! octave_set_signal_handler (sig, SIG_ACK)
#else
#define MAYBE_ACK_SIGNAL(sig) \
do { } while (0)
--- 88,94 ----
#if defined (__EMX__)
#define MAYBE_ACK_SIGNAL(sig) \
! signal (sig, SIG_ACK)
#else
#define MAYBE_ACK_SIGNAL(sig) \
do { } while (0)
***************
*** 122,128 ****
{
been_there_done_that = true;
! cerr << "error: " << sig_name << " -- stopping myself...\n";
save_user_variables ();
--- 129,135 ----
{
been_there_done_that = true;
! cerr << "\n\nerror: " << sig_name << " -- stopping myself...\n";
save_user_variables ();
***************
*** 139,144 ****
--- 146,154 ----
if (can_interrupt)
{
+ #ifdef __EMX__
+ _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
+ #endif
jump_to_top_level ();
panic_impossible ();
}
***************
*** 157,162 ****
--- 167,176 ----
sigemptyset (&oact.sa_mask);
sigaction (sig, &act, &oact);
return oact.sa_handler;
+ #elif defined (__EMX__)
+ sig_handler *signal_handler = signal (sig, handler);
+ MAYBE_ACK_SIGNAL(sig);
+ return signal_handler;
#else
return signal (sig, handler);
#endif
***************
*** 173,179 ****
// Handle SIGCHLD.
static RETSIGTYPE
! sigchld_handler (int /* sig */)
{
volatile octave_interrupt_handler saved_interrupt_handler
= octave_ignore_interrupts ();
--- 187,193 ----
// Handle SIGCHLD.
static RETSIGTYPE
! sigchld_handler (int sig )
{
volatile octave_interrupt_handler saved_interrupt_handler
= octave_ignore_interrupts ();
***************
*** 185,205 ****
#if defined (__EMX__)
volatile sig_handler *saved_sigchld_handler
= octave_set_signal_handler (SIGCHLD, SIG_IGN);
! #endif
!
sigset_t set, oset;
BLOCK_CHILD (set, oset);
int n = octave_child_list::length ();
! if (n == 0)
! {
! waitpid (-1, 0, WNOHANG);
! }
! else
! {
! for (int i = 0; i < n; i++)
{
octave_child& elt = octave_child_list::elem (i);
--- 199,214 ----
#if defined (__EMX__)
volatile sig_handler *saved_sigchld_handler
= octave_set_signal_handler (SIGCHLD, SIG_IGN);
! #else
sigset_t set, oset;
BLOCK_CHILD (set, oset);
+ #endif
+ int i = 0;
int n = octave_child_list::length ();
! for (i = 0; i < n; i++)
{
octave_child& elt = octave_child_list::elem (i);
***************
*** 215,234 ****
octave_child::dead_child_handler f = elt.handler;
! if (f)
! f (pid, status);
break;
}
}
}
! }
octave_set_interrupt_handler (saved_interrupt_handler);
UNBLOCK_CHILD (oset);
!
! #ifdef __EMX__
octave_set_signal_handler (SIGCHLD, saved_sigchld_handler);
#endif
--- 224,248 ----
octave_child::dead_child_handler f = elt.handler;
! if (f) f (pid, status);
! else
! {
! string file = elt.filename;
! unlink (file.c_str ());
! }
break;
}
}
}
!
! if (i == n) waitpid (-1, NULL, WNOHANG);
octave_set_interrupt_handler (saved_interrupt_handler);
+ #ifndef __EMX__
UNBLOCK_CHILD (oset);
! #else
octave_set_signal_handler (SIGCHLD, saved_sigchld_handler);
#endif
***************
*** 241,247 ****
#if defined (__alpha__)
static RETSIGTYPE
! sigfpe_handler (int /* sig */)
{
MAYBE_ACK_SIGNAL (SIGFPE);
--- 255,261 ----
#if defined (__alpha__)
static RETSIGTYPE
! sigfpe_handler (int sig)
{
MAYBE_ACK_SIGNAL (SIGFPE);
***************
*** 251,256 ****
--- 265,274 ----
if (can_interrupt)
{
+ #if defined (__EMX__)
+ _control87 (EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW |
+ EM_UNDERFLOW | EM_INEXACT, MCW_EM);
+ #endif
jump_to_top_level ();
panic_impossible ();
}
***************
*** 282,288 ****
}
static RETSIGTYPE
! sigpipe_handler (int /* sig */)
{
MAYBE_ACK_SIGNAL (SIGPIPE);
--- 300,306 ----
}
static RETSIGTYPE
! sigpipe_handler (int sig)
{
MAYBE_ACK_SIGNAL (SIGPIPE);
***************
*** 305,315 ****
octave_interrupt_handler retval;
#ifdef SIGINT
! retval.int_handler = octave_set_signal_handler (SIGINT, sigint_handler);
#endif
#ifdef SIGBREAK
! retval.brk_handler = octave_set_signal_handler (SIGBREAK, sigint_handler);
#endif
return retval;
--- 323,337 ----
octave_interrupt_handler retval;
#ifdef SIGINT
! octave_set_signal_handler (SIGINT, sigint_handler);
! retval.int_handler = sigint_handler;
! MAYBE_ACK_SIGNAL (SIGINT);
#endif
#ifdef SIGBREAK
! octave_set_signal_handler (SIGBREAK, sigint_handler);
! retval.brk_handler = sigint_handler;
! MAYBE_ACK_SIGNAL (SIGBREAK);
#endif
return retval;
***************
*** 332,347 ****
--- 354,392 ----
}
octave_interrupt_handler
+ octave_set_interrupt_handler (RETSIGTYPE (*f)(int))
+ {
+ octave_interrupt_handler retval;
+
+ if (f)
+ {
+ #ifdef SIGINT
+ retval.int_handler = octave_set_signal_handler (SIGINT, f);
+ MAYBE_ACK_SIGNAL (SIGINT);
+ #endif
+
+ #ifdef SIGBREAK
+ retval.brk_handler = octave_set_signal_handler (SIGBREAK, f);
+ MAYBE_ACK_SIGNAL (SIGBREAK);
+ #endif
+ }
+
+ return retval;
+ }
+
+ octave_interrupt_handler
octave_set_interrupt_handler (const volatile octave_interrupt_handler& h)
{
octave_interrupt_handler retval;
#ifdef SIGINT
retval.int_handler = octave_set_signal_handler (SIGINT, h.int_handler);
+ MAYBE_ACK_SIGNAL (SIGINT);
#endif
#ifdef SIGBREAK
retval.brk_handler = octave_set_signal_handler (SIGBREAK, h.brk_handler);
+ MAYBE_ACK_SIGNAL (SIGBREAK);
#endif
return retval;
***************
*** 425,432 ****
--- 470,481 ----
#endif
#ifdef SIGTERM
+ #ifdef __EMX__
+ signal (SIGTERM, SIG_DFL);
+ #else
octave_set_signal_handler (SIGTERM, generic_sig_handler);
#endif
+ #endif
#ifdef SIGTRAP
octave_set_signal_handler (SIGTRAP, generic_sig_handler);
***************
*** 570,576 ****
octave_child_list *octave_child_list::instance = 0;
void
! octave_child_list::do_insert (pid_t pid, octave_child::dead_child_handler f)
{
// Insert item in first open slot, increasing size of list if
// necessary.
--- 619,626 ----
octave_child_list *octave_child_list::instance = 0;
void
! octave_child_list::do_insert (pid_t pid, octave_child::dead_child_handler f,
! string name)
{
// Insert item in first open slot, increasing size of list if
// necessary.
***************
*** 583,589 ****
if (tmp.pid < 0)
{
! list (i) = octave_child (pid, f);
enlarge = false;
break;
}
--- 633,639 ----
if (tmp.pid < 0)
{
! list (i) = octave_child (pid, f, name);
enlarge = false;
break;
}
***************
*** 601,619 ****
list.resize (total_len * 2);
}
! list (curr_len) = octave_child (pid, f);
curr_len++;
}
}
void
! octave_child_list::insert (pid_t pid, octave_child::dead_child_handler f)
{
if (! instance)
instance = new octave_child_list ();
if (instance)
! instance->do_insert (pid, f);
else
panic_impossible ();
}
--- 651,670 ----
list.resize (total_len * 2);
}
! list (curr_len) = octave_child (pid, f, name);
curr_len++;
}
}
void
! octave_child_list::insert (pid_t pid, octave_child::dead_child_handler f,
! string name)
{
if (! instance)
instance = new octave_child_list ();
if (instance)
! instance->do_insert (pid, f, name);
else
panic_impossible ();
}
diff -cwr g:/project/C/octave-2.09.orig/src/sighandlers.h g:/project/C/octave-2.09/src/sighandlers.h
*** g:/project/C/octave-2.09.orig/src/sighandlers.h Wed May 28 03:36:48 1997
--- g:/project/C/octave-2.09/src/sighandlers.h Fri Mar 7 19:43:30 1997
***************
*** 22,30 ****
--- 22,34 ----
// This file should always be included after config.h!
+ /* Modified by Klaus Gebhardt, 1996 */
+
#if !defined (octave_sighandlers_h)
#define octave_sighandlers_h 1
+ #include <string>
+
#include <Array.h>
#include "syswait.h"
***************
*** 59,66 ****
typedef RETSIGTYPE sig_handler (int);
- // XXX FIXME XXX -- the data should probably be private...
-
struct
octave_interrupt_handler
{
--- 63,68 ----
***************
*** 89,94 ****
--- 91,99 ----
extern octave_interrupt_handler octave_ignore_interrupts (void);
extern octave_interrupt_handler
+ octave_set_interrupt_handler (RETSIGTYPE (*)(int));
+
+ extern octave_interrupt_handler
octave_set_interrupt_handler (const volatile octave_interrupt_handler&);
extern void octave_save_signal_mask (void);
***************
*** 112,122 ****
typedef void (*dead_child_handler) (pid_t, int);
! octave_child (pid_t id = -1, dead_child_handler f = 0)
! : pid (id), handler (f) { }
octave_child (const octave_child& oc)
! : pid (oc.pid), handler (oc.handler) { }
octave_child& operator = (const octave_child& oc)
{
--- 117,127 ----
typedef void (*dead_child_handler) (pid_t, int);
! octave_child (pid_t id = -1, dead_child_handler f = 0, string name = "")
! : pid (id), handler (f), filename (name) { }
octave_child (const octave_child& oc)
! : pid (oc.pid), handler (oc.handler), filename (oc.filename) { }
octave_child& operator = (const octave_child& oc)
{
***************
*** 124,129 ****
--- 129,135 ----
{
pid = oc.pid;
handler = oc.handler;
+ filename = oc.filename;
}
return *this;
}
***************
*** 135,140 ****
--- 141,149 ----
// The function we call if this child dies.
dead_child_handler handler;
+
+ // The file to remove if this child dies.
+ string filename;
};
class
***************
*** 148,154 ****
~octave_child_list (void) { }
! static void insert (pid_t pid, octave_child::dead_child_handler f);
static void remove (pid_t pid);
--- 157,164 ----
~octave_child_list (void) { }
! static void insert (pid_t pid, octave_child::dead_child_handler f,
! string name = "");
static void remove (pid_t pid);
***************
*** 177,183 ****
static octave_child_list *instance;
! void do_insert (pid_t pid, octave_child::dead_child_handler f);
void do_remove (pid_t pid);
};
--- 187,194 ----
static octave_child_list *instance;
! void do_insert (pid_t pid, octave_child::dead_child_handler f,
! string name = "");
void do_remove (pid_t pid);
};
diff -cwr g:/project/C/octave-2.09.orig/src/strftime.c g:/project/C/octave-2.09/src/strftime.c
*** g:/project/C/octave-2.09.orig/src/strftime.c Wed May 28 03:37:42 1997
--- g:/project/C/octave-2.09/src/strftime.c Fri Mar 7 22:55:12 1997
***************
*** 47,53 ****
# endif
#endif
! #if HAVE_TZNAME
extern char *tzname[];
#endif
--- 47,53 ----
# endif
#endif
! #ifdef HAVE_TZNAME
extern char *tzname[];
#endif
***************
*** 59,66 ****
with other C libraries that use unsafe encodings. */
#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
! #if DO_MULTIBYTE
! # if HAVE_MBRLEN
# include <wchar.h>
# else
/* Simulate mbrlen with mblen as best we can. */
--- 59,66 ----
with other C libraries that use unsafe encodings. */
#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
! #ifdef DO_MULTIBYTE
! #ifdef HAVE_MBRLEN
#include <wchar.h>
#else
/* Simulate mbrlen with mblen as best we can. */
***************
*** 71,81 ****
static const mbstate_t mbstate_zero;
#endif
! #if HAVE_LIMITS_H
# include <limits.h>
#endif
! #if STDC_HEADERS
# include <stddef.h>
# include <stdlib.h>
# include <string.h>
--- 71,81 ----
static const mbstate_t mbstate_zero;
#endif
! #ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
! #ifdef STDC_HEADERS
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
***************
*** 178,184 ****
} while (0)
#define cpy(n, s) add ((n), memcpy((PTR) p, (PTR) (s), (n)))
! #if ! HAVE_TM_GMTOFF
/* Yield the difference between *A and *B,
measured in seconds, ignoring leap seconds. */
static int tm_diff __P ((const struct tm *, const struct tm *));
--- 178,184 ----
} while (0)
#define cpy(n, s) add ((n), memcpy((PTR) p, (PTR) (s), (n)))
! #ifndef HAVE_TM_GMTOFF
/* Yield the difference between *A and *B,
measured in seconds, ignoring leap seconds. */
static int tm_diff __P ((const struct tm *, const struct tm *));
***************
*** 288,297 ****
register const char *f;
zone = 0;
! #if HAVE_TM_ZONE
zone = (const char *) tp->tm_zone;
#endif
! #if HAVE_TZNAME
if (!(zone && *zone) && tp->tm_isdst >= 0)
zone = tzname[tp->tm_isdst];
#endif
--- 288,297 ----
register const char *f;
zone = 0;
! #ifdef HAVE_TM_ZONE
zone = (const char *) tp->tm_zone;
#endif
! #ifdef HAVE_TZNAME
if (!(zone && *zone) && tp->tm_isdst >= 0)
zone = tzname[tp->tm_isdst];
#endif
***************
*** 318,324 ****
? INT_STRLEN_BOUND (time_t)
: INT_STRLEN_BOUND (int))];
! #if DO_MULTIBYTE
switch (*f)
{
--- 318,324 ----
? INT_STRLEN_BOUND (time_t)
: INT_STRLEN_BOUND (int))];
! #ifdef DO_MULTIBYTE
switch (*f)
{
***************
*** 480,486 ****
case 'C': /* POSIX.2 extension. */
if (modifier == 'O')
goto bad_format;
! #if HAVE_STRUCT_ERA_ENTRY
if (modifier == 'E')
{
struct era_entry *era = _nl_get_era_entry (tp);
--- 480,486 ----
case 'C': /* POSIX.2 extension. */
if (modifier == 'O')
goto bad_format;
! #ifdef HAVE_STRUCT_ERA_ENTRY
if (modifier == 'E')
{
struct era_entry *era = _nl_get_era_entry (tp);
***************
*** 781,787 ****
DO_NUMBER (1, tp->tm_wday);
case 'Y':
! #if HAVE_STRUCT_ERA_ENTRY
if (modifier == 'E')
{
struct era_entry *era = _nl_get_era_entry (tp);
--- 781,787 ----
DO_NUMBER (1, tp->tm_wday);
case 'Y':
! #ifdef HAVE_STRUCT_ERA_ENTRY
if (modifier == 'E')
{
struct era_entry *era = _nl_get_era_entry (tp);
***************
*** 798,804 ****
DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
case 'y':
! #if HAVE_STRUCT_ERA_ENTRY
if (modifier == 'E')
{
struct era_entry *era = _nl_get_era_entry (tp);
--- 798,804 ----
DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
case 'y':
! #ifdef HAVE_STRUCT_ERA_ENTRY
if (modifier == 'E')
{
struct era_entry *era = _nl_get_era_entry (tp);
***************
*** 822,828 ****
{
int diff;
! #if HAVE_TM_GMTOFF
diff = tp->tm_gmtoff;
#else
struct tm gtm;
--- 822,828 ----
{
int diff;
! #ifdef HAVE_TM_GMTOFF
diff = tp->tm_gmtoff;
#else
struct tm gtm;
diff -cwr g:/project/C/octave-2.09.orig/src/syscalls.cc g:/project/C/octave-2.09/src/syscalls.cc
*** g:/project/C/octave-2.09.orig/src/syscalls.cc Wed May 28 03:39:30 1997
--- g:/project/C/octave-2.09/src/syscalls.cc Tue May 27 15:31:30 1997
***************
*** 25,30 ****
--- 25,32 ----
//
// mkfifo unlink waitpid
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 32,37 ****
--- 34,40 ----
#include <cerrno>
#include <cstdio>
#include <cstring>
+ #include <csignal>
#ifdef HAVE_UNISTD_H
#ifdef HAVE_SYS_TYPES_H
***************
*** 44,49 ****
--- 47,54 ----
#include <fcntl.h>
#endif
+ #include <process.h>
+
#include "defun.h"
#include "error.h"
#include "file-ops.h"
***************
*** 54,59 ****
--- 59,66 ----
#include "oct-obj.h"
#include "oct-stdstrm.h"
#include "oct-stream.h"
+ #include "oct-fstrm.h"
+ #include "sighandlers.h"
#include "sysdep.h"
#include "syswait.h"
#include "utils.h"
***************
*** 87,94 ****
return m;
}
! DEFUN (dup2, args, ,
! "[FID, MSG] = dup2 (OLD, NEW)\n\
\n\
Duplicate a file descriptor.\n\
\n\
--- 94,148 ----
return m;
}
! DEFUN (_dup, args, ,
! "[FID, MSG] = _dup (old): duplicate a file descriptor")
! {
! octave_value_list retval;
!
! retval(1) = string ();
! retval(0) = -1.0;
!
! int nargin = args.length ();
!
! if (nargin == 1)
! {
! #if defined (HAVE_DUP)
! double d_old = args(0).double_value ();
!
! if (! error_state)
! {
! if (D_NINT (d_old) == d_old)
! {
! int i_old = NINT (d_old);
!
! // XXX FIXME XXX -- are these checks sufficient?
! if (i_old >= 0)
! {
! int status = dup (i_old);
!
! retval(0) = (double) status;
!
! if (status < 0)
! retval(1) = strerror (errno);
! }
! else
! error ("_dup: invalid file id");
! }
! else
! error ("_dup: argument must be integer value");
! }
! #else
! gripe_not_supported ("_dup");
! #endif
! }
! else
! print_usage ("_dup");
!
! return retval;
! }
!
! DEFUN (_dup2, args, ,
! "[FID, MSG] = _dup2 (OLD, NEW)\n\
\n\
Duplicate a file descriptor.\n\
\n\
***************
*** 126,142 ****
retval(1) = strerror (errno);
}
else
! error ("dup2: invalid file id");
}
else
! error ("dup2: arguments must be integer values");
}
#else
! gripe_not_supported ("dup2");
#endif
}
else
! print_usage ("dup2");
return retval;
}
--- 180,393 ----
retval(1) = strerror (errno);
}
else
! error ("_dup2: invalid file id");
! }
! else
! error ("_dup2: arguments must be integer values");
! }
! #else
! gripe_not_supported ("_dup2");
! #endif
! }
! else
! print_usage ("_dup2");
!
! return retval;
! }
!
! DEFUN (_close, args, ,
! "[RETVAL, MSG] = _close (fid): close a file handle")
! {
! octave_value_list retval;
!
! retval(1) = string ();
! retval(0) = -1.0;
!
! int nargin = args.length ();
!
! if (nargin == 1)
! {
! double d_old = args(0).double_value ();
!
! if (! error_state)
! {
! if (D_NINT (d_old) == d_old)
! {
! int i_old = NINT (d_old);
!
! // XXX FIXME XXX -- are these checks sufficient?
! if (i_old >= 0)
! {
! int status = close (i_old);
!
! retval(0) = (double) status;
!
! if (status < 0)
! retval(1) = strerror (errno);
! }
! else
! error ("_close: invalid file id");
! }
! else
! error ("_close: argument must be integer value");
! }
! }
! else
! print_usage ("_close");
!
! return retval;
! }
!
! DEFUN (_fdopen, args, ,
! "[FID, MSG] = _fdopen (fid, mode): create a stream for file handle")
! {
! octave_value_list retval;
!
! retval(1) = string ();
! retval(0) = -1.0;
!
! int nargin = args.length ();
!
! if (nargin == 2)
! {
! if (args(1).is_string ())
! {
! string mode = args(1).string_value ();
!
! double d_old = args(0).double_value ();
!
! if (! error_state)
! {
! if (D_NINT (d_old) == d_old)
! {
! int i_old = NINT (d_old);
!
! // XXX FIXME XXX -- are these checks sufficient?
! if (i_old >= 0)
! {
! if (mode == "r")
! {
! FILE *f = fdopen (i_old, "r");
! octave_istdiostream *is
! = new octave_istdiostream ("fdopen", f);
! retval(0) = octave_stream_list::insert (is);
! }
! else if (mode == "w")
! {
! FILE *f = fdopen (i_old, "w");
! octave_ostdiostream *os
! = new octave_ostdiostream ("fdopen", f);
! retval(0) = octave_stream_list::insert (os);
! }
! else
! error ("_fdopen: invalid mode");
! }
! else
! error ("_fdopen: invalid file id");
! }
! else
! error ("_fdopen: argument must be integer value");
! }
! }
! else
! error ("_fdopen: mode must be a string");
}
else
! print_usage ("_fdopen");
!
! return retval;
! }
!
! DEFUN (spawn, args, ,
! "[STATUS, MSG] = spawn (mode, file, args): run a program")
! {
! octave_value_list retval;
!
! retval(1) = string ();
! retval(0) = -1.0;
!
! int nargin = args.length ();
!
! if (nargin == 2 || nargin == 3)
! {
! #if defined (HAVE_SPAWNVP)
! string mode_strg = args(0).string_value ();
! string exec_file = args(1).string_value ();
!
! int mode = P_WAIT;
!
! if (mode_strg == "wait")
! mode = P_WAIT;
! else if (mode_strg == "nowait")
! mode = P_NOWAIT;
! else if (mode_strg == "detach")
! mode = P_DETACH;
! else if (mode_strg == "session")
! mode = P_SESSION;
! else if (mode_strg == "pm")
! mode = P_PM;
! else
! error ("system: invalid mode specified.");
!
! if (! error_state)
! {
! char **exec_args = 0;
!
! if (nargin == 3)
! {
! charMatrix chm = args(2).all_strings ();
!
! if (! error_state)
! {
! int nr = chm.rows ();
! int nc = chm.cols ();
!
! exec_args = new char * [nr+2];
!
! // XXX FIXME XXX -- potential leak?
!
! exec_args[0] = strsave (exec_file.c_str ());
! exec_args[nr+1] = 0;
!
! for (int i = 0; i < nr; i++)
! {
! exec_args[i+1] = new char [nc+1];
!
! for (int j = 0; j < nc; j++)
! exec_args[i+1][j] = chm (i, j);
!
! exec_args[i+1][nc] = '\0';
! }
! }
! else
! error ("spawn: arguments must be strings");
! }
! else
! {
! exec_args = new char * [2];
!
! exec_args[0] = strsave (exec_file.c_str ());
! exec_args[1] = 0;
}
+
+ if (! error_state)
+ {
+ int status = spawnvp (mode, exec_file.c_str (), exec_args);
+
+ retval(0) = (double) status;
+
+ if (status < 0)
+ retval(1) = strerror (errno);
+ }
+ }
+ else
+ error ("spawn: first two arguments must be strings");
#else
! gripe_not_supported ("spawn");
#endif
}
else
! print_usage ("spawn");
return retval;
}
***************
*** 224,231 ****
return retval;
}
! DEFUN (fcntl, args, ,
! "[STATUS, MSG] = fcntl (FID, REQUEST, ARGUMENT)\n\
\n\
Control open file descriptors.\n\
\n\
--- 475,482 ----
return retval;
}
! DEFUN (_fcntl, args, ,
! "[STATUS, MSG] = _fcntl (FID, REQUEST, ARGUMENT)\n\
\n\
Control open file descriptors.\n\
\n\
***************
*** 516,521 ****
--- 767,773 ----
if (nargin == 2)
{
+ #if defined (HAVE_MKFIFO)
if (args(0).is_string ())
{
string name = args(0).string_value ();
***************
*** 538,544 ****
}
else
error ("mkfifo: file name must be a string");
!
}
else
print_usage ("mkfifo");
--- 790,798 ----
}
else
error ("mkfifo: file name must be a string");
! #else
! gripe_not_supported ("mkfifo");
! #endif
}
else
print_usage ("mkfifo");
***************
*** 546,551 ****
--- 800,852 ----
return retval;
}
+ DEFUN (_pipe, args, ,
+ "[FIDS, STATUS, MSG] = _pipe (): create an interprocess channel.\n\
+ \n\
+ Return the FIDS corresponding to the reading and writing ends of\n\
+ the pipe, as a vector.\n\
+ \n\
+ You must open the FIDS using _fdopen!\n\
+ \n\
+ If successful, STATUS is 0 and MSG is an empty string. Otherwise,\n\
+ STATUS is nonzero and MSG contains a system-dependent error message.")
+ {
+ octave_value_list retval;
+
+ retval(2) = string ();
+ retval(1) = -1.0;
+ retval(0) = Matrix ();
+
+ int nargin = args.length ();
+
+ if (nargin == 0)
+ {
+ #if defined (HAVE_PIPE)
+ int fid[2];
+
+ int status = pipe (fid);
+
+ if (status < 0) retval(2) = strerror (errno);
+ else
+ {
+ Matrix file_ids (1, 2);
+
+ file_ids (0, 0) = (double) fid[0];
+ file_ids (0, 1) = (double) fid[1];
+
+ retval(0) = file_ids;
+ retval(1) = (double) status;
+ }
+ #else
+ gripe_not_supported ("_pipe");
+ #endif
+ }
+ else
+ print_usage ("_pipe");
+
+ return retval;
+ }
+
DEFUN (pipe, args, ,
"[FILE_IDS, STATUS, MSG] = pipe (): create an interprocess channel.\n\
\n\
***************
*** 766,773 ****
if (! error_state)
{
! pid_t status = waitpid (pid, 0, options);
retval(0) = (double) status;
if (status < 0)
--- 1067,1084 ----
if (! error_state)
{
! #ifdef __EMX__
! volatile octave_interrupt_handler saved_interrupt_handler
! = octave_ignore_interrupts ();
+ volatile sig_handler *saved_sigchld_handler
+ = octave_set_signal_handler (SIGCHLD, SIG_IGN);
+ #endif
+ pid_t status = waitpid (pid, 0, options);
+ #ifdef __EMX__
+ octave_set_interrupt_handler (saved_interrupt_handler);
+ octave_set_signal_handler (SIGCHLD, saved_sigchld_handler);
+ #endif
retval(0) = (double) status;
if (status < 0)
diff -cwr g:/project/C/octave-2.09.orig/src/sysdep.cc g:/project/C/octave-2.09/src/sysdep.cc
*** g:/project/C/octave-2.09.orig/src/sysdep.cc Thu Jul 10 15:57:24 1997
--- g:/project/C/octave-2.09/src/sysdep.cc Thu Jul 10 16:23:40 1997
***************
*** 28,33 ****
--- 28,35 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 59,64 ****
--- 61,71 ----
LOSE! LOSE!
#endif
+ #ifdef __EMX__
+ #include <float.h>
+ #include <sys/uflags.h>
+ #endif
+
#if defined (HAVE_FLOATINGPOINT_H)
#include <floatingpoint.h>
#endif
***************
*** 71,83 ****
#include <sys/utsname.h>
#endif
#if defined (USE_READLINE)
#include <readline/readline.h>
#include <readline/tilde.h>
#endif
-
extern char *term_clrpag;
extern "C" void _rl_output_character_function ();
#include "mach-info.h"
#include "oct-math.h"
--- 78,101 ----
#include <sys/utsname.h>
#endif
+ #ifndef __EMX__
#if defined (USE_READLINE)
#include <readline/readline.h>
#include <readline/tilde.h>
#endif
extern char *term_clrpag;
extern "C" void _rl_output_character_function ();
+ #else
+ #include <readline/readline.h>
+ #include <readline/tilde.h>
+ #include <sys/ioctl.h>
+ extern "C"
+ {
+ extern void tputs ();
+ extern char *term_clrpag;
+ extern void _rl_output_character_function ();
+ }
+ #endif
#include "mach-info.h"
#include "oct-math.h"
***************
*** 88,93 ****
--- 106,112 ----
#include "input.h"
#include "mappers.h"
#include "oct-obj.h"
+ #include "pager.h"
#include "pathlen.h"
#include "ov.h"
#include "sysdep.h"
***************
*** 139,144 ****
--- 158,165 ----
{
_control87 ((EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW
| EM_UNDERFLOW | EM_INEXACT), MCW_EM);
+
+ _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);
}
#endif
***************
*** 325,330 ****
--- 346,352 ----
kbhit (void)
{
int c;
+ flush_octave_stdout ();
raw_mode (1);
c = cin.get ();
raw_mode (0);
***************
*** 469,475 ****
// XXX FIXME XXX -- add timeout and default value args?
! if (interactive)
{
int c = kbhit ();
char *s = new char [2];
--- 491,497 ----
// XXX FIXME XXX -- add timeout and default value args?
! if (interactive || really_forced_interactive)
{
int c = kbhit ();
char *s = new char [2];
***************
*** 565,570 ****
--- 587,597 ----
if (delay > 0)
usleep (delay);
+ #elif defined (HAVE__SLEEP2)
+ int delay = NINT (dval / 1e3);
+
+ if (delay > 0)
+ _sleep2 (delay);
#else
int delay = NINT (dval / 1e6);
***************
*** 678,683 ****
--- 705,731 ----
DEFALIAS (EXTPROC, extproc);
+ DEFUN (add_to_command_number, args, ,
+ "add_to_command_number: add argument to the current command number")
+ {
+ octave_value_list retval;
+ int nargin;
+
+ if ((nargin = args.length ()) != 1)
+ {
+ print_usage ("add_to_command_number");
+ return retval;
+ }
+
+ double tmp_d = args(0).double_value ();
+
+ if (error_state || ((int) tmp_d != tmp_d))
+ error ("add_to_command_number: expecting integer as argument");
+ else
+ current_command_number += (int) tmp_d;
+
+ return retval;
+ }
#endif
/*
diff -cwr g:/project/C/octave-2.09.orig/src/toplev.cc g:/project/C/octave-2.09/src/toplev.cc
*** g:/project/C/octave-2.09.orig/src/toplev.cc Wed Jun 25 14:59:32 1997
--- g:/project/C/octave-2.09/src/toplev.cc Wed Jun 25 15:29:44 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 - 1997 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 77,82 ****
--- 79,92 ----
#include "variables.h"
#include <version.h>
+ #ifdef __EMX__
+ extern "C"
+ {
+ #include <process.h>
+ int _IO_system (const char *, int);
+ }
+ #endif
+
// argv[0] for this program.
string Vprogram_invocation_name;
***************
*** 142,147 ****
--- 152,162 ----
void
parse_and_execute (FILE *f, int print)
{
+ volatile octave_interrupt_handler old_interrupt_handler
+ = octave_ignore_interrupts ();
+
+ volatile jmp_buf old_toplevel = toplevel;
+
begin_unwind_frame ("parse_and_execute");
YY_BUFFER_STATE old_buf = current_buffer ();
***************
*** 160,165 ****
--- 175,184 ----
unwind_protect_ptr (curr_sym_tab);
+ if (setjmp(toplevel) == 0)
+ {
+ octave_set_interrupt_handler (old_interrupt_handler);
+
int retval;
do
{
***************
*** 196,203 ****
--- 215,228 ----
}
}
while (retval == 0);
+ }
+ else error ("script executing interrupted ...");
run_unwind_frame ("parse_and_execute");
+
+ octave_ignore_interrupts ();
+ toplevel = old_toplevel;
+ octave_set_interrupt_handler (old_interrupt_handler);
}
static void
***************
*** 211,216 ****
--- 236,244 ----
parse_and_execute (const string& s, int print, int verbose,
const char *warn_for)
{
+ volatile octave_interrupt_handler old_interrupt_handler
+ = octave_ignore_interrupts ();
+
begin_unwind_frame ("parse_and_execute_2");
unwind_protect_int (reading_script_file);
***************
*** 247,252 ****
--- 275,282 ----
error ("%s: unable to open file `%s'", warn_for, s.c_str ());
run_unwind_frame ("parse_and_execute_2");
+
+ octave_set_interrupt_handler (old_interrupt_handler);
}
int
***************
*** 258,263 ****
--- 288,297 ----
if (setjmp (toplevel) != 0)
{
+ #if defined (__EMX__) && defined (OS2)
+ run_all_unwind_protects ();
+ #endif
+
raw_mode (0);
cout << "\n";
***************
*** 274,279 ****
--- 308,318 ----
int retval;
do
{
+ #ifdef __EMX__
+ can_interrupt = 1;
+ octave_catch_interrupts ();
+ #endif
+
curr_sym_tab = top_level_sym_tab;
reset_parser ();
***************
*** 288,294 ****
global_command = 0;
! if (! (interactive || forced_interactive))
{
bool quit = (returning || breaking);
--- 327,334 ----
global_command = 0;
! if (! (interactive || forced_interactive
! || really_forced_interactive))
{
bool quit = (returning || breaking);
***************
*** 304,310 ****
if (error_state)
{
! if (! (interactive || forced_interactive))
break;
}
else
--- 344,351 ----
if (error_state)
{
! if (! (interactive || forced_interactive
! || really_forced_interactive))
break;
}
else
***************
*** 372,383 ****
cleanup_tmp_files ();
! if (!quitting_gracefully && (interactive || forced_interactive))
cout << "\n";
if (retval == EOF)
retval = 0;
exit (retval);
// This is bogus but should prevent g++ from giving a warning saying
--- 413,429 ----
cleanup_tmp_files ();
! if (!quitting_gracefully &&
! (interactive || forced_interactive || really_forced_interactive))
cout << "\n";
if (retval == EOF)
retval = 0;
+ #if defined (__EMX__)
+ _sleep2 (500);
+ #endif
+
exit (retval);
// This is bogus but should prevent g++ from giving a warning saying
***************
*** 582,588 ****
octave_value_list tmp = eval_string (s, print, parse_status, 1);
- if (tmp.length () > 0)
retval = tmp(0);
return retval;
--- 628,633 ----
***************
*** 762,768 ****
--- 807,817 ----
string cmd_str = args(0).string_value ();
+ #if defined (__EMX__) && defined (OS2)
+ enum exec_type { sync, async, pm };
+ #else
enum exec_type { sync, async };
+ #endif
exec_type type = sync;
***************
*** 778,785 ****
--- 827,842 ----
type = sync;
else if (type_str == "async")
type = async;
+ #if defined (__EMX__) && defined (OS2)
+ else if (type_str == "pm")
+ type = pm;
+ else
+ error ("system: third arg must be \"sync\" , \"async\""
+ "or \"pm\"");
+ #else
else
error ("system: third arg must be \"sync\" or \"async\"");
+ #endif
}
else
error ("system: third argument must be a string");
***************
*** 790,797 ****
--- 847,859 ----
if (! error_state)
{
+ #if defined (__EMX__) && defined (OS2)
+ if (type == async || type == pm)
+ #else
if (type == async)
+ #endif
{
+ #ifndef __EMX__
pid_t pid = fork ();
if (pid < 0)
***************
*** 804,815 ****
--- 866,897 ----
}
else
retval(0) = (double) pid;
+ #else
+ pid_t pid;
+ int p_mode;
+ #ifdef OS2
+ if (type == pm) p_mode = P_PM;
+ else p_mode = P_NOWAIT;
+ #else
+ p_mode = P_NOWAIT;
+ #endif
+ pid = _IO_system (cmd_str.c_str (), p_mode);
+
+ if (pid < 0)
+ error ("system: spawn failed -- can't create child process");
+ else
+ retval(0) = (double) pid;
+ #endif
}
else if (return_output)
retval = run_command_and_return_output (cmd_str);
else
{
+ #ifdef __EMX__
+ int status = _IO_system (cmd_str.c_str (), P_WAIT);
+ #else
int status = system (cmd_str.c_str ());
+ #endif
// The value in status is as returned by waitpid. If
// the process exited normally, extract the actual exit
***************
*** 831,839 ****
DEFALIAS (shell_cmd, system);
! // XXX FIXME XXX -- this should really be static, but that causes
! // problems on some systems.
! SLStack<string> octave_atexit_functions;
void
do_octave_atexit (void)
--- 913,919 ----
DEFALIAS (shell_cmd, system);
! static SLStack<string> octave_atexit_functions;
void
do_octave_atexit (void)
diff -cwr g:/project/C/octave-2.09.orig/src/utils.cc g:/project/C/octave-2.09/src/utils.cc
*** g:/project/C/octave-2.09.orig/src/utils.cc Thu Jul 10 15:57:24 1997
--- g:/project/C/octave-2.09/src/utils.cc Thu Jul 10 16:23:40 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 102,108 ****
--- 104,112 ----
extern "C" void
jump_to_top_level (void)
{
+ #if ! defined (__EMX__) || ! defined (OS2)
run_all_unwind_protects ();
+ #endif
longjmp (toplevel, 1);
}
diff -cwr g:/project/C/octave-2.09.orig/src/variables.cc g:/project/C/octave-2.09/src/variables.cc
*** g:/project/C/octave-2.09.orig/src/variables.cc Wed May 28 03:39:32 1997
--- g:/project/C/octave-2.09/src/variables.cc Mon May 26 18:24:16 1997
***************
*** 20,25 ****
--- 20,27 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
***************
*** 487,496 ****
if (! have_help_text)
{
first_comments_seen = true;
! help_txt += (char) c;
}
! if (c == '\n')
{
if (update_pos)
{
--- 489,510 ----
if (! have_help_text)
{
first_comments_seen = true;
! if (c == '\r')
! {
! int d = getc (ffile);
! if (c != '\n' && c != '\r' && c != '')
! help_txt += (char) '\n';
! #if defined (EMX09C)
! fseek (ffile, -1l, SEEK_CUR);
! #else
! ungetc (d, ffile);
! #endif
! }
! else if (c == '') help_txt += (char) '\n';
! else help_txt += (char) c;
}
! if (c == '\n' || c == '')
{
if (update_pos)
{
***************
*** 505,512 ****
{
if (update_pos)
current_input_column--;
ungetc (c, ffile);
! if (c == '\n')
break;
}
else
--- 519,530 ----
{
if (update_pos)
current_input_column--;
+ #if defined (EMX09C)
+ fseek (ffile, -1l, SEEK_CUR);
+ #else
ungetc (c, ffile);
! #endif
! if (c == '\n' || c == '\r' || c == '')
break;
}
else
***************
*** 524,529 ****
--- 542,553 ----
have_help_text = true;
break;
+ case '\r':
+ if (first_comments_seen) have_help_text = true;
+ if (update_pos) current_input_column = 0;
+ continue;
+
+ case '':
case '\n':
if (first_comments_seen)
have_help_text = true;
***************
*** 543,549 ****
--- 567,577 ----
default:
if (update_pos)
current_input_column--;
+ #if defined (EMX09C)
+ fseek (ffile, -1l, SEEK_CUR);
+ #else
ungetc (c, ffile);
+ #endif
goto done;
}
}
***************
*** 791,797 ****
if (! path.empty ())
{
! FILE *fptr = fopen (path.c_str (), "r");
if (fptr)
{
--- 819,825 ----
if (! path.empty ())
{
! FILE *fptr = fopen (path.c_str (), "rb");
if (fptr)
{
diff -cwr g:/project/C/octave-2.09.orig/src/version.h g:/project/C/octave-2.09/src/version.h
*** g:/project/C/octave-2.09.orig/src/version.h Thu Jul 10 15:57:24 1997
--- g:/project/C/octave-2.09/src/version.h Fri Jul 18 01:22:28 1997
***************
*** 20,25 ****
--- 20,47 ----
*/
+ /* Modified by Klaus Gebhardt, 1996 */
+
+ #if defined (__EMX__) && defined (OS2)
+ #define OCTAVE_VERSION "2.0.9"
+ #define OCTAVE_OS2_PATCHLEVEL "2.09-b03"
+
+ #define OCTAVE_COPYRIGHT \
+ "Copyright (C) 1996, 1997 John W. Eaton.\n\
+ OS/2-Port by Klaus Gebhardt, 1996 - 1997."
+
+ #define OCTAVE_NAME_AND_VERSION \
+ "Octave " OCTAVE_VERSION " for OS/2 2.x, Warp 3 and Warp 4.\n(Patchlevel " \
+ OCTAVE_OS2_PATCHLEVEL ")"
+
+ #define OCTAVE_NAME_VERSION_AND_COPYRIGHT \
+ OCTAVE_NAME_AND_VERSION ".\n" OCTAVE_COPYRIGHT "\n\
+ This is free software with ABSOLUTELY NO WARRANTY."
+
+ #define OCTAVE_STARTUP_MESSAGE \
+ OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\
+ For details, type `warranty'."
+ #else
#define OCTAVE_VERSION "2.0.9"
#define OCTAVE_COPYRIGHT \
***************
*** 35,41 ****
#define OCTAVE_STARTUP_MESSAGE \
OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\
For details, type `warranty'."
!
/*
;;; Local Variables: ***
;;; mode: C++ ***
--- 57,63 ----
#define OCTAVE_STARTUP_MESSAGE \
OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\
For details, type `warranty'."
! #endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
diff -cwr g:/project/C/octave-2.09.orig/src/y.tab.h g:/project/C/octave-2.09/src/y.tab.h
*** g:/project/C/octave-2.09.orig/src/y.tab.h Tue Dec 10 08:54:26 1996
--- g:/project/C/octave-2.09/src/y.tab.h Wed Aug 20 18:08:14 1997
***************
*** 21,26 ****
--- 21,29 ----
tree_if_command *tree_if_command_type;
tree_if_clause *tree_if_clause_type;
tree_if_command_list *tree_if_command_list_type;
+ tree_switch_command *tree_switch_command_type;
+ tree_switch_case *tree_switch_case_type;
+ tree_switch_case_list *tree_switch_case_list_type;
tree_global *tree_global_type;
tree_global_init_list *tree_global_init_list_type;
tree_global_command *tree_global_command_type;
***************
*** 70,98 ****
#define IF 291
#define ELSEIF 292
#define ELSE 293
! #define BREAK 294
! #define CONTINUE 295
! #define FUNC_RET 296
! #define UNWIND 297
! #define CLEANUP 298
! #define TRY 299
! #define CATCH 300
! #define GLOBAL 301
! #define TEXT_ID 302
! #define LEXICAL_ERROR 303
! #define FCN 304
! #define SCREW_TWO 305
! #define ELLIPSIS 306
! #define ALL_VA_ARGS 307
! #define END_OF_INPUT 308
! #define USING 309
! #define TITLE 310
! #define WITH 311
! #define COLON 312
! #define OPEN_BRACE 313
! #define CLOSE_BRACE 314
! #define CLEAR 315
! #define UNARY 316
extern YYSTYPE yylval;
--- 73,104 ----
#define IF 291
#define ELSEIF 292
#define ELSE 293
! #define SWITCH 294
! #define CASE 295
! #define OTHERWISE 296
! #define BREAK 297
! #define CONTINUE 298
! #define FUNC_RET 299
! #define UNWIND 300
! #define CLEANUP 301
! #define TRY 302
! #define CATCH 303
! #define GLOBAL 304
! #define TEXT_ID 305
! #define LEXICAL_ERROR 306
! #define FCN 307
! #define SCREW_TWO 308
! #define ELLIPSIS 309
! #define ALL_VA_ARGS 310
! #define END_OF_INPUT 311
! #define USING 312
! #define TITLE 313
! #define WITH 314
! #define COLON 315
! #define OPEN_BRACE 316
! #define CLOSE_BRACE 317
! #define CLEAR 318
! #define UNARY 319
extern YYSTYPE yylval;
diff -cwr g:/project/C/octave-2.09.orig/scripts/image/image.m g:/project/C/octave-2.09/scripts/image/image.m
*** g:/project/C/octave-2.09.orig/scripts/image/image.m Sun Nov 3 06:52:00 1996
--- g:/project/C/octave-2.09/scripts/image/image.m Mon Mar 10 00:53:24 1997
***************
*** 19,66 ****
## Display an octave image matrix.
##
! ## image (x) displays a matrix as a color image. The elements of x are
## indices into the current colormap and should have values between 1
## and the length of the colormap.
##
- ## image (x, zoom) changes the zoom factor. The default value is 4.
- ##
## SEE ALSO: imshow, imagesc, colormap.
## Author: Tony Richardson <amr@mpl.ucsd.edu>
## Created: July 1994
## Adapted-By: jwe
function image (x, zoom)
if (nargin == 0)
## Load Bobbie Jo Richardson (Born 3/16/94)
! x = loadimage ("default.img");
! zoom = 2;
elseif (nargin == 1)
! zoom = 4;
elseif (nargin > 2)
usage ("image (matrix, [zoom])");
endif
! ppm_name = tmpnam ();
!
! saveimage (ppm_name, x, "ppm");
!
! ## Start the viewer. Try xv, then xloadimage.
!
! xv = sprintf ("xv -expand %f %s", zoom, ppm_name);
!
! xloadimage = sprintf ("xloadimage -zoom %f %s", zoom*100, ppm_name);
!
! rm = sprintf ("rm -f %s", ppm_name);
! ## Need to let the shell clean up the tmp file because we are putting
! ## the viewer in the background.
! command = sprintf ("( %s || %s && %s ) > /dev/null 2>&1 &",
! xv, xloadimage, rm);
! system (command);
endfunction
--- 19,54 ----
## Display an octave image matrix.
##
! ## image (x[, map]) displays a matrix as a color image. The elements of x are
## indices into the current colormap and should have values between 1
## and the length of the colormap.
##
## SEE ALSO: imshow, imagesc, colormap.
## Author: Tony Richardson <amr@mpl.ucsd.edu>
## Created: July 1994
## Adapted-By: jwe
+ ## Modified by Klaus Gebhardt, 1996 - 1997
function image (x, zoom)
if (nargin == 0)
## Load Bobbie Jo Richardson (Born 3/16/94)
! [x, map] = loadimage ("default.img");
elseif (nargin == 1)
! zoom = 1;
elseif (nargin > 2)
usage ("image (matrix, [zoom])");
endif
! pnm_name = tmpnam ();
! saveimage (pnm_name, x, "pnm");
! ## Start the viewer.
! i = findstr (pnm_name, "/");
! pnm_name (i) = "\\";
! system (sprintf ("oct-view %s %f", pnm_name, zoom));
endfunction
diff -cwr g:/project/C/octave-2.09.orig/scripts/image/loadimage.m g:/project/C/octave-2.09/scripts/image/loadimage.m
*** g:/project/C/octave-2.09.orig/scripts/image/loadimage.m Wed May 28 03:35:58 1997
--- g:/project/C/octave-2.09/scripts/image/loadimage.m Sun Jan 26 02:13:52 1997
***************
*** 1,64 ****
! ## Copyright (C) 1996 John W. Eaton
##
- ## This file is part of Octave.
- ##
- ## Octave is free software; you can redistribute it and/or modify it
- ## under the terms of the GNU General Public License as published by
- ## the Free Software Foundation; either version 2, or (at your option)
- ## any later version.
- ##
- ## Octave is distributed in the hope that it will be useful, but
- ## WITHOUT ANY WARRANTY; without even the implied warranty of
- ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- ## General Public License for more details.
- ##
- ## You should have received a copy of the GNU General Public License
- ## along with Octave; see the file COPYING. If not, write to the Free
- ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- ## 02111-1307, USA.
-
## Load an image file.
##
! ## [img, map] = loadimage (img_file) loads an image and it's associated
! ## color map from file img_file. The image must be in stored in
! ## octave's image format.
##
## SEE ALSO: saveimage, load, save
! ## Author: Tony Richardson <amr@mpl.ucsd.edu>
! ## Created: July 1994
! ## Adapted-By: jwe
! function [img_retval, map_retval] = loadimage (filename)
! if (nargin != 1)
! usage ("[img, map] = loadimage (filename)");
elseif (! isstr (filename))
error ("loadimage: expecting filename as a string");
endif
! file = file_in_path (IMAGEPATH, filename);
!
! if (isempty (file))
! error ("loadimage: unable to find image file");
endif
! ## The file is assumed to have variables img and map, or X and map.
! eval (['load ', file]);
! if (exist ("img"))
! img_retval = img;
! elseif (exist ("X"))
! img_retval = X;
! else
! error ("loadimage: invalid image file found");
endif
! if (exist ("map"))
! map_retval = map;
! else
! error ("loadimage: invalid image file found");
! endif
endfunction
--- 1,37 ----
! ## Copyright (C) 1996 Klaus Gebhardt
##
## Load an image file.
##
! ## [X, map] = loadimage (img_file, fmt) loads an image and its associated
! ## color map from file img_file.
##
## SEE ALSO: saveimage, load, save
! ## Author: Klaus Gebhardt <gebhardt@crunch.ikp.physik.th-darmstadt.de>
! ## Created: November 1996
! function [X, map] = loadimage (filename, fmt)
! if (nargin != 1 && nargin != 2)
! usage ("loadimage (filename[, fmt])");
elseif (! isstr (filename))
error ("loadimage: expecting filename as a string");
endif
! if (nargin == 1)
! fmt = "img";
endif
! if (! isstr (fmt))
! error ("loadimage: expecting fmt as a string");
! endif
! file = file_in_path (IMAGEPATH, filename);
! if (isempty (file))
! error ("loadimage: unable to find image file");
endif
! eval (sprintf ("[X, map] = %s_dec (file);", fmt));
endfunction
diff -cwr g:/project/C/octave-2.09.orig/scripts/image/saveimage.m g:/project/C/octave-2.09/scripts/image/saveimage.m
*** g:/project/C/octave-2.09.orig/scripts/image/saveimage.m Wed May 28 03:35:58 1997
--- g:/project/C/octave-2.09/scripts/image/saveimage.m Tue Jan 28 22:59:44 1997
***************
*** 1,101 ****
! ## Copyright (C) 1996 John W. Eaton
##
- ## This file is part of Octave.
- ##
- ## Octave is free software; you can redistribute it and/or modify it
- ## under the terms of the GNU General Public License as published by
- ## the Free Software Foundation; either version 2, or (at your option)
- ## any later version.
- ##
- ## Octave is distributed in the hope that it will be useful, but
- ## WITHOUT ANY WARRANTY; without even the implied warranty of
- ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- ## General Public License for more details.
- ##
- ## You should have received a copy of the GNU General Public License
- ## along with Octave; see the file COPYING. If not, write to the Free
- ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- ## 02111-1307, USA.
-
## Save a matrix to disk in image format.
##
! ## saveimage (filename, x) saves matrix x to file filename in octave's
## image format. The current colormap is saved in the file also.
##
- ## saveimage (filename, x, "img") saves the image in the default format
- ## and is the same as saveimage (filename, x).
- ##
- ## saveimage (filename, x, "ppm") saves the image in ppm format instead
- ## of the default octave image format.
- ##
- ## saveimage (filename, x, "ps") saves the image in PostScript format
- ## instead of the default octave image format. (Note: images saved in
- ## PostScript format can not be read back into octave with loadimage.)
- ##
## saveimage (filename, x, format, map) saves the image along with the
## specified colormap in the specified format.
##
- ## Note: If the colormap contains only two entries and these entries
- ## are black and white, the bitmap ppm and PostScript formats are used.
- ## If the image is a gray scale image (the entries within each row of
- ## the colormap are equal) the gray scale ppm and PostScript image
- ## formats are used, otherwise the full color formats are used.
- ##
- ## The conversion to PostScript is based on pbmtolps.c, which was
- ## written by
- ##
- ## George Phillips <phillips@cs.ubc.ca>
- ## Department of Computer Science
- ## University of British Columbia
- ##
- ## and is part of the portable bitmap utilities,
- ##
- ## SEE ALSO: loadimage, save, load, colormap
-
- ## Author: Tony Richardson <amr@mpl.ucsd.edu>
- ## Created: July 1994
- ## Adapted-By: jwe
! ## Rewritten by jwe to avoid using octoppm and pbm routines so that
! ## people who don't have the the pbm stuff installed can still use this
! ## function.
! ##
! ## The conversion to PostScript is based on pnmtops.c, which is part of
! ## the portable bitmap utilties and bears this copyright notice:
! ##
! ## Copyright (C) 1989 by Jef Poskanzer.
! ##
! ## Permission to use, copy, modify, and distribute this software and its
! ## documentation for any purpose and without fee is hereby granted, provided
! ## that the above copyright notice appear in all copies and that both that
! ## copyright notice and this permission notice appear in supporting
! ## documentation. This software is provided "as is" without express or
! ## implied warranty.
! function saveimage (filename, img, img_form, map)
! if (nargin < 2 || nargin > 4)
! usage ("saveimage (filename, matrix, [format, [colormap]])");
endif
if (nargin < 4)
map = colormap ();
endif
- [map_nr, map_nc] = size (map);
-
- if (map_nc != 3)
- error ("colormap should be an N x 3 matrix");
- endif
-
if (nargin < 3)
img_form = "img";
elseif (! isstr (img_form))
error ("image format specification must be a string");
- elseif (! (strcmp (img_form, "img")
- || strcmp (img_form, "ppm")
- || strcmp (img_form, "ps")))
- error ("unsupported image format specification");
endif
if (! is_matrix (img))
--- 1,31 ----
! ## Copyright (C) 1996 Klaus Gebhardt
##
## Save a matrix to disk in image format.
##
! ## saveimage (filename, x) saves matrix x to file filename in octaves
## image format. The current colormap is saved in the file also.
##
## saveimage (filename, x, format, map) saves the image along with the
## specified colormap in the specified format.
##
! ## Author: Klaus Gebhardt <gebhardt@crunch.ikp.physik.th-darmstadt.de>
! ## Created: November 1996
! function saveimage (filename, img, img_form, map, opt)
! if (nargin < 2 || nargin > 5)
! usage ("saveimage (filename, matrix, [format, [colormap, [opt]]])");
endif
if (nargin < 4)
map = colormap ();
endif
if (nargin < 3)
img_form = "img";
elseif (! isstr (img_form))
error ("image format specification must be a string");
endif
if (! is_matrix (img))
***************
*** 106,301 ****
error ("file name must be a string");
endif
! ## If we just want Octave image format, save and return.
!
! if (strcmp (img_form, "img"))
! eval (strcat ("save -ascii ", filename, " map img"));
! return;
! endif
!
! ## Convert to another format if requested.
!
! grey = all (map(:,1) == map(:,2) && map(:,1) == map (:,3));
!
! pbm = pgm = ppm = 0;
!
! map_sz = map_nr * map_nc;
!
! map = reshape (map, map_sz, 1);
!
! idx = find (map > 1);
! map (idx) = ones (size (idx));
!
! idx = find (map < 0);
! map (idx) = zeros (size (idx));
!
! map = round (255 * map);
!
! bw = (map_nr == 2
! && ((map(1,1) == 0 && map(2,1) == 255)
! || (map(1,1) == 255 && map(2,1) == 0)));
!
! img = round (img');
! [img_nr, img_nc] = size (img);
!
! img_sz = img_nr * img_nc;
! img = reshape (img, img_sz, 1);
!
! idx = find (img > map_nr);
! img (idx) = ones (size (idx)) * map_nr;
!
! idx = find (img <= 0);
! img (idx) = ones (size (idx));
!
! if (strcmp (img_form, "ppm"))
! if (grey && map_nr == 2 && bw)
!
! map = map(:,1);
!
! if (map(1) != 0)
! map(1) = 1;
! else
! map(2) = 1;
! endif
!
! img = map(img);
! n_long = rem (img_sz, 8);
! if (n_long == 0)
! n_long = 8;
! else
! n_long++;
! endif
!
! idx = 1:8:img_sz;
! s_len = length (idx) - 1;
!
! tmp = img (1:8:img_sz) * 128;
! for i = 2:n_long
! tmp = tmp + img (i:8:img_sz) * 2^(8-i);
! endfor
! for i = (n_long+1):8
! tmp(1:s_len) = tmp(1:s_len) + img (i:8:img_sz) * 2^(8-i);
! endfor
!
! fid = fopen (filename, "w");
! fprintf (fid, "P4\n%d %d\n", img_nr, img_nc);
! fwrite (fid, tmp, "char");
! fprintf (fid, "\n");
! fclose (fid);
!
! elseif (grey)
!
! fid = fopen (filename, "w");
! fprintf (fid, "P5\n%d %d\n255\n", img_nr, img_nc);
! fwrite (fid, map(img), "uchar");
! fprintf (fid, "\n");
! fclose (fid);
!
! else
!
! img_idx = ((1:3:3*img_sz)+2)';
! map_idx = ((2*map_nr+1):map_sz)';
!
! tmap = map(map_idx);
! tmp(img_idx--) = tmap(img);
!
! map_idx = map_idx - map_nr;
! tmap = map(map_idx);
! tmp(img_idx--) = tmap(img);
!
! map_idx = map_idx - map_nr;
! tmap = map(map_idx);
! tmp(img_idx--) = tmap(img);
!
! fid = fopen (filename, "w");
! fprintf (fid, "P6\n%d %d\n255\n", img_nr, img_nc);
! fwrite (fid, tmp, "uchar");
! fprintf (fid, "\n");
! fclose (fid);
!
! endif
!
! elseif (strcmp (img_form, "ps") == 1)
!
! if (! grey)
! error ("must have a greyscale color map for conversion to PostScript");
! endif
!
! bps = 8;
! dpi = 300;
! pagewid = 612;
! pagehgt = 762;
! MARGIN = 0.95;
! devpix = dpi / 72.0 + 0.5;
! pixfac = 72.0 / dpi * devpix;
!
! ## Compute padding to round cols * bps up to the nearest multiple of 8
! ## (nr and nc are switched because we transposed the image above).
!
! padright = (((img_nr * bps + 7) / 8) * 8 - img_nr * bps) / bps;
!
! scols = img_nr * pixfac;
! srows = img_nc * pixfac;
!
! if (scols > pagewid * MARGIN || srows > pagehgt * MARGIN)
! if (scols > pagewid * MARGIN)
! scale = scale * (pagewid / scols * MARGIN);
! scols = scale * img_nr * pixfac;
! srows = scale * img_nc * pixfac;
! endif
! if (srows > pagehgt * MARGIN)
! scale = scale * (pagehgt / srows * MARGIN);
! scols = scale * img_nr * pixfac;
! srows = scale * img_nc * pixfac;
! endif
! warning ("image too large for page, rescaling to %g", scale);
! endif
!
! llx = (pagewid - scols) / 2;
! lly = (pagehgt - srows) / 2;
! urx = llx + fix (scols + 0.5);
! ury = lly + fix (srows + 0.5);
!
! fid = fopen (filename, "w");
!
! fprintf (fid, "%%!PS-Adobe-2.0 EPSF-2.0\n");
! fprintf (fid, "%%%%Creator: Octave %s (saveimage.m)\n", OCTAVE_VERSION);
! fprintf (fid, "%%%%Title: %s\n", filename);
! fprintf (fid, "%%%%Pages: 1\n");
! fprintf (fid, "%%%%BoundingBox: %d %d %d %d\n",
! fix (llx), fix (lly), fix (urx), fix (ury));
! fprintf (fid, "%%%%EndComments\n" );
! fprintf (fid, "/readstring {\n");
! fprintf (fid, " currentfile exch readhexstring pop\n");
! fprintf (fid, "} bind def\n");
! fprintf (fid, "/picstr %d string def\n",
! fix ((img_nr + padright) * bps / 8));
! fprintf (fid, "%%%%EndProlog\n");
! fprintf (fid, "%%%%Page: 1 1\n");
! fprintf (fid, "gsave\n");
! fprintf (fid, "%g %g translate\n", llx, lly);
! fprintf (fid, "%g %g scale\n", scols, srows);
! fprintf (fid, "%d %d %d\n", img_nr, img_nc, bps);
! fprintf (fid, "[ %d 0 0 -%d 0 %d ]\n", img_nr, img_nc, img_nc);
! fprintf (fid, "{ picstr readstring }\n" );
! fprintf (fid, "image\n" );
!
! img = map(img);
!
! fmt = "%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x\n";
! fprintf (fid, fmt, img);
!
! if (rem (img_sz, 30) != 0)
! fprintf (fid, "\n" );
! endif
!
! fprintf (fid, "grestore\n" );
! fprintf (fid, "showpage\n" );
! fprintf (fid, "%%%%Trailer\n" );
! fclose (fid);
!
else
! error ("saveimage: what happened to the image type?");
endif
endfunction
--- 36,45 ----
error ("file name must be a string");
endif
! if (nargin < 5)
! eval (sprintf ("%s_enc (filename, map, img);", img_form));
else
! eval (sprintf ("%s_enc (filename, map, img, opt);", img_form));
endif
endfunction
diff -cwr g:/project/C/octave-2.09.orig/scripts/miscellaneous/bug_report.m g:/project/C/octave-2.09/scripts/miscellaneous/bug_report.m
*** g:/project/C/octave-2.09.orig/scripts/miscellaneous/bug_report.m Wed May 28 03:39:24 1997
--- g:/project/C/octave-2.09/scripts/miscellaneous/bug_report.m Wed May 28 02:45:10 1997
***************
*** 24,29 ****
--- 24,30 ----
## you are finished editing.
## Author: jwe
+ ## Modified by Klaus Gebhardt, 1997
function bug_report ()
***************
*** 49,55 ****
endif
endif
! cmd = strcat (OCTAVE_HOME, "/bin/octave-bug");
if (length (subject) > 0)
cmd = sprintf ("%s -s \"%s\"", cmd, subject);
--- 50,56 ----
endif
endif
! cmd = strcat (OCTAVE_HOME, "/octave-bug");
if (length (subject) > 0)
cmd = sprintf ("%s -s \"%s\"", cmd, subject);
diff -cwr g:/project/C/octave-2.09.orig/scripts/miscellaneous/popen2.m g:/project/C/octave-2.09/scripts/miscellaneous/popen2.m
*** g:/project/C/octave-2.09.orig/scripts/miscellaneous/popen2.m Mon Jul 15 23:20:20 1996
--- g:/project/C/octave-2.09/scripts/miscellaneous/popen2.m Tue May 27 16:11:32 1997
***************
*** 1,4 ****
! ## Copyright (C) 1996 John W. Eaton
##
## This file is part of Octave.
##
--- 1,4 ----
! ## Copyright (C) 1997 Klaus Gebhardt
##
## This file is part of Octave.
##
***************
*** 21,28 ****
##
## Start a subprocess with two-way communication. COMMAND specifies
## the name of the command to start. ARGS is an array of strings
! ## containing options for COMMAND. IN and out are the file ids of the
! ## input and streams for the subprocess, and PID is the process id of
## the subprocess, or -1 if COMMAND could not be executed.
##
## Example:
--- 21,28 ----
##
## Start a subprocess with two-way communication. COMMAND specifies
## the name of the command to start. ARGS is an array of strings
! ## containing options for COMMAND. IN and OUT are the file ids of the
! ## input and output streams for the subprocess, and PID is the process id of
## the subprocess, or -1 if COMMAND could not be executed.
##
## Example:
***************
*** 38,44 ****
## endwhile
## fclose (out);
! ## Author: jwe
function [in, out, pid] = popen2 (command, args)
--- 38,44 ----
## endwhile
## fclose (out);
! ## Author: Klaus Gebhardt, 1997
function [in, out, pid] = popen2 (command, args)
***************
*** 48,98 ****
if (nargin == 1 || nargin == 2)
- if (nargin == 1)
- args = "";
- endif
-
if (isstr (command))
! [stdin_pipe, stdin_status] = pipe ();
! [stdout_pipe, stdout_status] = pipe ();
! if (stdin_status == 0 && stdout_status == 0)
! pid = fork ();
! if (pid == 0)
! fclose (stdin_pipe (2));
! fclose (stdout_pipe (1));
! dup2 (stdin_pipe (1), stdin);
! fclose (stdin_pipe (1));
! dup2 (stdout_pipe (2), stdout);
! fclose (stdout_pipe (2));
! if (exec (command, args) < 0)
! error ("popen2: unable to start process `%s'", command);
! exit (0);
endif
! elseif (pid)
! fclose (stdin_pipe (1));
! fclose (stdout_pipe (2));
- if (fcntl (stdout_pipe (1), __F_SETFL__, __O_NONBLOCK__) < 0)
- error ("popen2: error setting file mode");
else
! in = stdin_pipe (2);
! out = stdout_pipe (1);
endif
! elseif (pid < 0)
! error ("popen2: fork failed -- unable to create child process");
endif
! else
error ("popen2: pipe creation failed");
endif
else
--- 48,114 ----
if (nargin == 1 || nargin == 2)
if (isstr (command))
! [r_pipe, r_status] = _pipe ();
! [w_pipe, w_status] = _pipe ();
! if ((r_status != -1) && (w_status != -1))
! r_parent_end = r_pipe(1);
! r_child_end = r_pipe(2);
! _fcntl (r_parent_end, F_SETFD, 1);
! r_org = _dup (1);
! w_parent_end = w_pipe(2);
! w_child_end = w_pipe(1);
! _fcntl (w_parent_end, F_SETFD, 1);
! w_org = _dup (0);
! if ((r_org != -1) && (w_org != -1))
! _dup2 (r_child_end, 1); _close (r_child_end); r_child_end = -1;
! _dup2 (w_child_end, 0); _close (w_child_end); w_child_end = -1;
! if (nargin == 1)
! pid = spawn ("nowait", command);
! else
! pid = spawn ("nowait", command, args);
! endif
! _dup2 (r_org, 1); _close (r_org);
! _dup2 (w_org, 0); _close (w_org);
! endif
!
! if (r_child_end != -1)
! _close (r_child_end);
endif
! if (w_child_end != -1)
! _close (w_child_end);
! endif
! if (pid < 0)
! _close (r_parent_end);
! _close (w_parent_end);
! error ("popen2: unable to start process `%s'", command);
! else
! out = _fdopen (r_parent_end, "r");
! in = _fdopen (w_parent_end, "w");
! endif
else
!
! if (r_status != -1)
! _close (r_pipe(1));
! _close (r_pipe(2));
endif
! if (wr_status != -1)
! _close (w_pipe(1));
! _close (w_pipe(2));
endif
!
error ("popen2: pipe creation failed");
endif
else
diff -cwr g:/project/C/octave-2.09.orig/scripts/plot/sombrero.m g:/project/C/octave-2.09/scripts/plot/sombrero.m
*** g:/project/C/octave-2.09.orig/scripts/plot/sombrero.m Wed May 28 03:37:34 1997
--- g:/project/C/octave-2.09/scripts/plot/sombrero.m Fri Mar 7 05:02:46 1997
***************
*** 22,28 ****
## Draw a `sombrero' in three dimensions using n grid lines. The
## function plotted is
##
! ## z = sin (sqrt (x^2 + y^2)) / (sqrt (x^2 + y^2))
## Author: jwe
--- 22,28 ----
## Draw a `sombrero' in three dimensions using n grid lines. The
## function plotted is
##
! ## z = sin (x^2 + y^2) / (sqrt (x^2 + y^2))
## Author: jwe
diff -cwr g:/project/C/octave-2.09.orig/scripts/startup/octaverc g:/project/C/octave-2.09/scripts/startup/octaverc
*** g:/project/C/octave-2.09.orig/scripts/startup/octaverc Wed Jul 24 19:05:42 1996
--- g:/project/C/octave-2.09/scripts/startup/octaverc Mon May 26 15:54:04 1997
***************
*** 2,4 ****
--- 2,33 ----
##
## This file should contain any commands that should be executed each
## time Octave starts for every user at this site.
+
+ ## System-wide startup file
+ ## Octave 2.06 for OS/2
+ ## (c) 1996, Klaus Gebhardt
+
+ PS1 = "octave:\\#>"
+
+ EDITOR = "e";
+
+ if length(getenv("OCTAVE_HOME"))
+ LOADPATH = sprintf("%s/scripts//", getenv("OCTAVE_HOME"));
+ INFO_FILE = sprintf("%s/doc/octave", getenv("OCTAVE_HOME"));
+ endif
+
+ if length(file_in_path(getenv("PATH"),"less.exe"))
+ PAGER = sprintf("%s -ce",file_in_path(getenv("PATH"),"less.exe"));
+ else
+ PAGER = "more";
+ endif
+
+ if length(getenv("GNUPLOT"))
+ gnuplot_binary = sprintf ("%s/gnuplot.exe", getenv("GNUPLOT"));
+ else
+ gnuplot_binary = "gnuplot";
+ endif
+
+ implicit_str_to_num_ok = 1;
+ ok_to_lose_imaginary_part = 1;
+ ignore_function_time_stamp = 1;
diff -cwr g:/project/C/octave-2.09.orig/doc/conf.tex g:/project/C/octave-2.09/doc/conf.tex
*** g:/project/C/octave-2.09.orig/doc/conf.tex Wed Aug 13 12:39:44 1997
--- g:/project/C/octave-2.09/doc/conf.tex Wed Aug 13 12:27:12 1997
***************
*** 3,7 ****
@c For copying conditions, see the file gpl.tex.
@set VERSION 2.0.5
! @set OCTAVEHOME /usr/local
! @set TARGETHOSTTYPE i586-pc-linux-gnu
--- 3,7 ----
@c For copying conditions, see the file gpl.tex.
@set VERSION 2.0.5
! @set OCTAVEHOME
! @set TARGETHOSTTYPE i486-OS/2
diff -cwr g:/project/C/octave-2.09.orig/doc/faq/oct-faq.tex g:/project/C/octave-2.09/doc/faq/oct-faq.tex
*** g:/project/C/octave-2.09.orig/doc/faq/oct-faq.tex Wed Aug 13 12:39:46 1997
--- g:/project/C/octave-2.09/doc/faq/oct-faq.tex Wed Aug 13 12:49:08 1997
***************
*** 1,3 ****
--- 1,4 ----
+ % Modified by Klaus Gebhardt, 1997
\input texinfo.tex @c -*-texinfo-*-
@setfilename oct-faq.
***************
*** 19,24 ****
--- 20,33 ----
@top
@unnumbered Preface
@cindex FAQ for Octave, latest version
+
+ @macro email{text}
+ (\text\)
+ @end macro
+
+ @macro url{text}
+ (\text\)
+ @end macro
@end ifinfo
This is a list of frequently asked questions (FAQ) for Octave users.
diff -cwr g:/project/C/octave-2.09.orig/doc/interpreter/control.tex g:/project/C/octave-2.09/doc/interpreter/control.tex
*** g:/project/C/octave-2.09.orig/doc/interpreter/control.tex Wed Aug 13 12:39:50 1997
--- g:/project/C/octave-2.09/doc/interpreter/control.tex Wed Aug 13 12:27:36 1997
***************
*** 369,374 ****
--- 369,375 ----
@tex
$AXA^T - X + B B^T = 0$ or $A^TXA - X + B^TB = 0$,
@end tex
+ @end iftex
@ifinfo
@code{a x a' - x + b b' = 0} or @code{a' x a - x + b' b = 0},
@end ifinfo
diff -cwr g:/project/C/octave-2.09.orig/doc/interpreter/octave.tex g:/project/C/octave-2.09/doc/interpreter/octave.tex
*** g:/project/C/octave-2.09.orig/doc/interpreter/octave.tex Wed Aug 13 12:40:04 1997
--- g:/project/C/octave-2.09/doc/interpreter/octave.tex Wed Aug 13 12:48:28 1997
***************
*** 1,6 ****
--- 1,7 ----
% Copyright (C) 1996, 1997 John W. Eaton
% This is part of the Octave manual.
% For copying conditions, see the file gpl.tex.
+ % Modified by Klaus Gebhardt, 1997
\input texinfo
@setfilename octave.
***************
*** 11,16 ****
--- 12,25 ----
* Octave: (octave). Interactive language for numerical computations.
END-INFO-DIR-ENTRY
@end format
+
+ @macro email{text}
+ (\text\)
+ @end macro
+
+ @macro url{text}
+ (\text\)
+ @end macro
@end ifinfo
@c Settings for printing on 8-1/2 by 11 inch paper:
***************
*** 36,42 ****
@c This file doesn't include a chapter, so it must not be included
@c if you want to run the Emacs function texinfo-multiple-files-update.
! @include conf.tex
@settitle GNU Octave
--- 45,51 ----
@c This file doesn't include a chapter, so it must not be included
@c if you want to run the Emacs function texinfo-multiple-files-update.
! @include ../conf.tex
@settitle GNU Octave
diff -cwr g:/project/C/octave-2.09.orig/doc/interpreter/poly.tex g:/project/C/octave-2.09/doc/interpreter/poly.tex
*** g:/project/C/octave-2.09.orig/doc/interpreter/poly.tex Wed Aug 13 12:40:06 1997
--- g:/project/C/octave-2.09/doc/interpreter/poly.tex Wed Aug 13 12:27:52 1997
***************
*** 8,22 ****
In Octave, a polynomial is represented by its coefficients (arranged
in descending order). For example, a vector
@iftex
@end iftex
@ifinfo
! $c$
@end ifinfo
of length
@iftex
@tex
$N+1$
@end tex
@ifinfo
@var{N+1}
@end ifinfo
--- 8,24 ----
In Octave, a polynomial is represented by its coefficients (arranged
in descending order). For example, a vector
@iftex
+ $c$
@end iftex
@ifinfo
! @var{c}
@end ifinfo
of length
@iftex
@tex
$N+1$
@end tex
+ @end iftex
@ifinfo
@var{N+1}
@end ifinfo
diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/array.tex g:/project/C/octave-2.09/doc/liboctave/array.tex
*** g:/project/C/octave-2.09.orig/doc/liboctave/array.tex Wed Aug 13 12:40:16 1997
--- g:/project/C/octave-2.09/doc/liboctave/array.tex Wed Aug 13 12:28:14 1997
***************
*** 1,4 ****
! @node Arrays, Matrix and Vector @var{Operations}, Introduction, Top
@chapter Arrays
@cindex arrays
--- 1,4 ----
! @node Arrays, Matrix and Vector Operations, Introduction, Top
@chapter Arrays
@cindex arrays
diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/factor.tex g:/project/C/octave-2.09/doc/liboctave/factor.tex
*** g:/project/C/octave-2.09.orig/doc/liboctave/factor.tex Wed Aug 13 12:40:20 1997
--- g:/project/C/octave-2.09/doc/liboctave/factor.tex Wed Aug 13 12:28:18 1997
***************
*** 1,4 ****
! @node Matrix Factorizations, Ranges, Matrix and Vector @var{Operations}, Top
@chapter Matrix Factorizations
@cindex matrix factorizations
@cindex factorizations
--- 1,4 ----
! @node Matrix Factorizations, Ranges, Matrix and Vector Operations, Top
@chapter Matrix Factorizations
@cindex matrix factorizations
@cindex factorizations
diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/gpl.tex g:/project/C/octave-2.09/doc/liboctave/gpl.tex
*** g:/project/C/octave-2.09.orig/doc/liboctave/gpl.tex Wed Aug 13 12:40:20 1997
--- g:/project/C/octave-2.09/doc/liboctave/gpl.tex Wed Aug 13 12:28:20 1997
***************
*** 1,4 ****
! @c Copyright (C) 1996, 1997 John W. Eaton
@c This is part of the Octave manual.
@c For copying conditions, see the file gpl.tex.
--- 1,4 ----
! @c Copyright (C) 1996 John W. Eaton
@c This is part of the Octave manual.
@c For copying conditions, see the file gpl.tex.
diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/liboct.tex g:/project/C/octave-2.09/doc/liboctave/liboct.tex
*** g:/project/C/octave-2.09.orig/doc/liboctave/liboct.tex Wed Aug 13 12:40:22 1997
--- g:/project/C/octave-2.09/doc/liboctave/liboct.tex Wed Aug 13 12:49:14 1997
***************
*** 1,6 ****
--- 1,7 ----
% Copyright (C) 1996, 1997 John W. Eaton
% This is part of the Octave manual.
% For copying conditions, see the file gpl.tex.
+ % Modified by Klaus Gebhardt, 1997
\input texinfo @c -*-texinfo-*-
@setfilename liboct.
***************
*** 28,39 ****
@c This file doesn't include a chapter, so it must not be included
@c if you want to run the Emacs function texinfo-multiple-files-update.
! @include conf.tex
@settitle Octave C++ Classes
@ifinfo
Copyright (C) 1996, 1997 John W. Eaton.
Permission is granted to make and distribute verbatim copies of
--- 29,48 ----
@c This file doesn't include a chapter, so it must not be included
@c if you want to run the Emacs function texinfo-multiple-files-update.
! @include ../conf.tex
@settitle Octave C++ Classes
@ifinfo
+ @macro email{text}
+ (\text\)
+ @end macro
+
+ @macro url{text}
+ (\text\)
+ @end macro
+
Copyright (C) 1996, 1997 John W. Eaton.
Permission is granted to make and distribute verbatim copies of
***************
*** 98,104 ****
* Copying::
* Introduction::
* Arrays::
! * Matrix and Vector @var{Operations}::
* Matrix Factorizations::
* Ranges::
* Nonlinear Functions::
--- 107,113 ----
* Copying::
* Introduction::
* Arrays::
! * Matrix and Vector Operations::
* Matrix Factorizations::
* Ranges::
* Nonlinear Functions::
diff -cwr g:/project/C/octave-2.09.orig/doc/liboctave/matvec.tex g:/project/C/octave-2.09/doc/liboctave/matvec.tex
*** g:/project/C/octave-2.09.orig/doc/liboctave/matvec.tex Wed Aug 13 12:40:22 1997
--- g:/project/C/octave-2.09/doc/liboctave/matvec.tex Wed Aug 13 12:28:22 1997
***************
*** 107,113 ****
@c ------------------------------------------------------------------------
! @node Matrix and Vector @var{Operations}, Matrix Factorizations, Arrays, Top
@chapter Matrix and Vector Operations
@cindex matrix manipulations
@cindex vector manipulations
--- 107,113 ----
@c ------------------------------------------------------------------------
! @node Matrix and Vector Operations, Matrix Factorizations, Arrays, Top
@chapter Matrix and Vector Operations
@cindex matrix manipulations
@cindex vector manipulations